question

HavaDaniel-0558 avatar image
1 Vote"
HavaDaniel-0558 asked XiaopoYang-MSFT answered

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

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://docs.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-11windows-api
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I‘m looking into this. Please Wait for a while. I have run it successfully in Windows10.

2 Votes 2 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello @HavaDaniel-0558,

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

XiaopoYang-MSFT avatar image
0 Votes"
XiaopoYang-MSFT answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.