English
Source / code snippets

inquire create Icon left Mouse button rights Tray

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
Tray-Icon create and inquire (left and rights Mouse button)
#######################
Topic : Tray-Icon
#######################
Andreas Miethe
august 2003
#######################
 $H windows.ph
 $H structs.ph
 $H messages.ph
 $H shellapi.ph
DEF &WM_SHELLNOTIFY  ~WM_USER + 5 shell notify message
DEF &uID 7777
Struct Point = ~Point
Struct note  = ~NOTIFYICONDATA
Declare Point#,TB_CREATED&
Declare Ende&,note#,hint$
SetTrueColor 1
Window %maxx,0 - 640,480Window next to whom screen
CLS ~GetSysColor(~COLOR_BTNFACE)
~ShowWindow(%hwnd,~SW_HIDE)Window hide
~SetWindowPos(%hwnd,0,0,0,640,480,OR(~SWP_NOREDRAW,~SWP_NOACTIVATE))new position
Dim note#,note
Clear note#
Note#.cbSize&           = sizeof(note#)
Note#.hWnd&             = %hwnd
Note#.uID&              = &uID
Note#.hIcon&            = ~LoadIcon(%hInstance,A)
Note#.uFlags&           = Or(Or(~NIF_ICON,~NIF_TIP),~NIF_MESSAGE)
Note#.uCallbackMessage& = &WM_SHELLNOTIFY
Note#.szTip#            =  Tray-Icon demonstration
~Shell_NotifyIcon(~NIM_ADD, note#)
TB_CREATED& = ~RegisterWindowMessage(IconCreated)
User Messages &WM_SHELLNOTIFY,TB_CREATED&,~WM_CLOSE

Whilenot Ende&

    Waitinput

    If ~IsIconic(%hwnd)Window minimizes ??

        ~ShowWindow(%hwnd,~SW_HIDE)

    Endif

    If %UMessage = ~WM_CLOSE

        ~Shell_NotifyIcon(~NIM_DELETE,note#)
        Ende& = 1

    Endif

    If %UMessage = TB_CREATED&Explorer-Crash. Icon new lay out

        ~Shell_NotifyIcon(~NIM_ADD,note#)

    Endif

    If %UMessage = &WM_SHELLNOTIFY

        If &ULParam = ~WM_RBUTTONDOWNrechter Mausbutton

            ~SetForegroundWindow(%hWnd)
            Dim Point#,Point
            CreateMenu
            AppendMenu 100,Window hide
            AppendMenu 101,Window show
            Separator
            AppendMenu 102,end
            ~GetCursorPos(Point#)
            ~MapWindowPoints(%Desktop,%hwnd,Point#,1)
            Trackmenu Point#.x&,Point#.y&
            Dispose Point#

        Endif

        If &ULParam = ~WM_LBUTTONDOWNlinker Mausbutton

            ~SetForegroundWindow(%hWnd)
            Dim Point#,Point
            CreateMenu
            AppendMenu 200,Linker Button 1
            AppendMenu 201,Linker Button 2
            Separator
            AppendMenu 202,Linker Button 3
            ~GetCursorPos(Point#)
            ~MapWindowPoints(%Desktop,%hwnd,Point#,1)
            Trackmenu Point#.x&,Point#.y&
            Dispose Point#

        Endif

    Endif

    If MenuItem(100)

        ~ShowWindow(%hwnd,~SW_HIDE)

    ElseIf Menuitem(101)

        SendMessage(%hwnd,~WM_SYSCOMMAND,~SC_RESTORE,0)

    ElseIf Menuitem(102)

        ~Shell_NotifyIcon(~NIM_DELETE,note#)
        Ende& = 1

    Endif

Wend

 
07/15/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.769 Views

Untitledvor 0 min.
Georg Teles vor 27 Tagen
H.Brill09/20/23
maroro06/15/18
Uwe Lang02/06/18
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (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