简体   繁体   中英

System Tray Notifications: Are they standard windows or Owner Drawn Popup Menus or other?

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.

在此输入图像描述 在此输入图像描述

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM