Reputation: 25928
Are notification/alert windows (that appear above the Windows System Tray) like the examples below just a standard window, owner drawn HMENU
's or are they implemented using NOTIFYICONDATA
? Note: I know that the actual system tray icon is implemented using NOTIFYICONDATA
, but are the notification windows also implemented using this structure?
In my WinAPI C++ application I want to show a similar notification where it will appear above the system tray icon, have buttons, horizontal scroll bars and etc. I know I can just create a new HWND, position it above the system tray and show that but if there is a specific WinAPI 'System Tray Notification' class/function I would prefer to use that, thus my question.
Upvotes: 3
Views: 1009
Reputation: 595369
Are notification/alert windows (that appear above the Windows System Tray) like the examples below just a standard window, owner drawn HMENU's or are they implemented using NOTIFYICONDATA?
These are custom dialogs displayed when needed. They are not implemented using NOTIFYICONDATA
. You can use Shell_NotifyIconGetRect()
to get the current location of your tray icon when needed.
Upvotes: 3
Reputation: 175748
Tray notifications are all about notifying the process that owns the icon that a click event has occurred so it can then do its thing, whatever that may be.
There is no specialised mechanism or framework for anything GUI related in this case.
Best Practices: When a user right-clicks the icon, it should bring up a normal shortcut menu. However, the result of a single click with the left mouse button will vary with the function of the icon. It should display what the user would expect to see in the form best suited to that content—a popup window, a dialog box or the program window itself. For instance, it could show status text for a status icon, or a slider for the volume control.
Upvotes: 1