Hello,
I have an application that has an notification icon in taskbar and show a flyout when user hovers mouse over it. This relies on WM_POPUPOPEN and WM_POPUPCLOSE messages. This behavior is also described in docs (https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyiconw).
The problem is, it doesn't work on Win11 (build 22000.258) as these messages are not generated. The text tooltip is shown instead even though I did not include NIF_SHOWTIP flag (only NIF_TIP).
Reproduction:
Get NotificationIcon.cpp solution from MS examples and apply following change
--- a/Samples/Win7Samples/winui/shell/appshellintegration/NotificationIcon/NotificationIcon.cpp
+++ b/Samples/Win7Samples/winui/shell/appshellintegration/NotificationIcon/NotificationIcon.cpp
@@ -91,7 +91,7 @@ BOOL AddNotificationIcon(HWND hwnd)
nid.hWnd = hwnd;
// add the icon, setting the icon, tooltip, and callback message.
// the icon will be identified with the GUID
- nid.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE | NIF_SHOWTIP | NIF_GUID;
+ nid.uFlags = NIF_ICON | NIF_TIP | NIF_MESSAGE | NIF_GUID;
nid.guidItem = __uuidof(PrinterIcon);
nid.uCallbackMessage = WMAPP_NOTIFYCALLBACK;
LoadIconMetric(g_hInst, MAKEINTRESOURCE(IDI_NOTIFICATIONICON), LIM_SMALL, &nid.hIcon);
@@ -299,6 +299,8 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WMAPP_NOTIFYCALLBACK:
switch (LOWORD(lParam))
{
+ case NIN_POPUPOPEN:
+ case NIN_POPUPCLOSE:
case NIN_SELECT:
// for NOTIFYICON_VERSION_4 clients, NIN_SELECT is prerable to listening to mouse clicks and key presses
// directly.
On Win10 printer flyout is correctly displayed on mouse hover and on Win11 you only get the text tooltip.
Thanks a lot for any info.
Dan