English
Applications

Systemtray with TrayIcon-Menu and Images

 
RGH
and here for all Mitleser, The know want, How one at all Applications for Systemtray Windows in XProfan program, one complete Beispiellisting with TrayIcon-Menu and Images in the same:
Declare Hicon&,end%,Show%
Declare Checkmerker%,Menuhandle&
Declare hbmChecked&,hbmUnchecked&
DEF SetMenuItemBitmaps(5) !USER32,SetMenuItemBitmaps

Proc Ico2SizedBmp

    Parameters Icon&, dx&, dy&
    Weiße temporary Bitmap in Size 32 * 32 produce
    Var TempBmp& = Create(hNewPic, 32, 32, RGB(255,255,255))
    On these Bitmap the Icon draw
    StartPaint TempBmp&
    DrawIcon Icon&, 0, 0
    EndPaint
    Weiße Bitmap in Size dx& * dy& produce
    Var IBmp& = Create(hNewPic, dx&, dy&, RGB(255,255,255))
    On these Bitmap The temporary Bitmap minimizes draw
    StartPaint IBmp&
    DrawSizedPic TempBmp&, 0, 0 - dx&, dy&; 0
    EndPaint
    DeleteObject TempBmp&
    Return IBmp&

ENDPROC

Proc Menue

    CreateMenu
    AppendMenu 101, &Info
    AppendMenu 102, &deaktiviert
    SetMenuItemBitmaps(&hMenu,102,$10,hbmChecked&,hbmUnChecked&)  Menu-graphic ändern...
    AppendMenu 106, Mainwindow &visible
    SetMenuItemBitmaps(&hMenu,106,$10,hbmChecked&,hbmUnChecked&)  Menu-graphic ändern...
    AppendMenu 104, -
    AppendMenu 103, &terminate
    CheckMenu 106, Show%
    CheckMenu 102, Checkmerker%
    Return @TrackMenu()

ENDPROC

Windowstyle 26 + 512
Window Title TrayIcon_Test
Window 0,0-640,480
@ShowWindow(%hWnd,0)
Hicon&        = @create(hIcon,Profan)
hbmChecked&   = Ico2SizedBmp(@create(hIcon, A),13,13)
hbmUnChecked& = Ico2SizedBmp(@create(hIcon, tree),13,13)
@TrayIcon(Add, %hWnd, 1, hIcon&, TrayIcon 11)

Whilenot end%

    Waitinput

    If @TrayIcon(Msg, 1) = $203 Double click left

        end%=1

    Elseif @TrayIcon(Msg, 1) = $204 right Mausbutton pressed

        @SetActiveWindow(%hWnd)
        Menue()

        If (%MenuItem = 102)

            Checkmerker% = @hardship(Checkmerker%) Zustandsänderung remember...

            If Checkmerker% = 0

                Hicon& = @create(hIcon, A)
                @TrayIcon(SetIcon, %hWnd, 1, hIcon&)

            Else

                Hicon& = @create(hIcon, tree)
                @TrayIcon(SetIcon, %hWnd, 1, hIcon&)

            EndIf

            Setmenuitem 0

        ElseIf (%MenuItem = 101)

            @Messagebox(program in XProfan 11,Info,64)
            Setmenuitem 0

        ElseIf (%MenuItem = 103)

            end%=1

        ElseIf (%MenuItem = 106)

            Show% = @hardship(Show%)
            @Showwindow(%hWnd,Show%)
            Setmenuitem 0

        EndIf

    Endif

Endwhile

@TrayIcon(Delete, %hWnd, 1)
End
Greeting
Roland
 
02/12/09  
 



Zur Anwendung


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.870 Views

Untitledvor 0 min.
Member 361000511/14/22
Member 766256608/24/19
Axel Berse03/02/19
p.specht10/08/18
More...

Themeninformationen

this Topic has 1 subscriber:

iF (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie