Re: System Tray Application
You at least need a window to receive notifications.
Read up on Shell_NotifyIcon, that along with NOTIFYICONDATA struct should give you a good starting point.
Make sure to remove your icon from the system tray before your application exits, otherwise it will hang around forever.
Re: System Tray Application
Just search the forum with 'TrayIcon' keyword. You will get a lot of stuffs.
Re: System Tray Application
This thread has a class I wrote attached you can use to make it simple.
Re: System Tray Application
Quote:
How does one begin to program system tray applications?
Could you please define "system tray application." If this is what I understand, this is an application like any other one, with just a system tray icon added and handled properly. So a good starting point is to develop your application without system tray icon, and add the icon support later. :)
Re: System Tray Application
Thank you ejmw, hypheni, Skizmo and Igor for replying and sorry for the late reply!
Igor, that's a very appropriate sketch of what i've done. I just need to incorporate the system tray icon.
Update: The icon appears in the tray (i'm using IDI_QUESTION because i haven't designed an .ico yet) but quickly disappears as soon as i roll the mouse over it.
I still need more info unfortunately so i'd be extremely grateful for any leads.
Thanks.
Re: System Tray Application
I just got the icon to stay. However, I'm still clueless about capturing messages like WM_RBUTTONDOWN and displaying a menu for it.
Re: System Tray Application
Search the forum for "system tray" and "tray icon", and you're gonna find lots of code snippets. But Shell_NotifyIcon should be carefully read first anyway.
Re: System Tray Application
Thanks Igor, I tried searching with "system tray WM_" and i found out that if I
1.) #define WM_NOTIFYICON WM_USER+1
2.) nid.uCallbackMessage = WM_NOTIFYICON
3.) ON_MESSAGE(WM_NOTIFYICON, OnTrayNot)
the messages start getting captured.
2 Attachment(s)
Re: System Tray Application
Have a look at the attached files. I wrote this class a few months back.
And the Mouse button capturing code is in the .h file, commented part.
Re: System Tray Application
Search with
Shellnotifyiconex,c++ function