[Windows 11] VM_POPUPOPEN message is not generated when hovering mouse over notification icon

Húšťava Daniel 6 Reputation points
2021-10-13T11:09:29.06+00:00

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

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,422 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,166 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Limitless Technology 39,351 Reputation points
    2021-10-15T09:06:52.647+00:00

    Hello @Húšťava Daniel ,

    Thank you for your question.

    In fact, some features that were previously present in windows 10 may not be functional in windows 11, I believe there may be a way to solve this.

    However, I recommend that you create a question in the windows 11 forum itself, because there you will have all the assistance you need to get around this problem in a way that is most useful to you.

    To do this, access the link below and select the option "Ask a question" from the top menu and then describe the entire problem, including images:

    https://answers.microsoft.com/en-us/windows/forum?sort=LastReplyDate&dir=Desc&tab=All&status=all&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&isFilterExpanded=false&page=1

    --------------------------------------------------------------------------------------------------------------------------------

    If the answer is helpful, please vote positively and accept as an answer.

    0 comments No comments

  2. Xiaopo Yang - MSFT 11,496 Reputation points Microsoft Vendor
    2021-10-20T06:30:31.163+00:00

    May you can send feedback to Microsoft with the Windows Feedback Hub about the behavior. But It’s probably not a bug in Windows11.

    0 comments No comments