SetForegroundWindow(hDlg);
// Display the menu
TrackPopupMenu( hSubMenu,
TPM_RIGHTBUTTON,
pt.x,
pt.y,
0,
hDlg,
NULL);
PostMessage(hDlg, WM_NULL, 0, 0);
【resolved】maui TrayIcon with ContextMenuStrip not close when app lose focus (windows)
zd yu
41
Reputation points MVP
i am learning maui.
The above source code shows the tray icon with menu created by winapi.
How to close this menu in response to mouse click events(any click include from other apps)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Windows development | Windows API - Win32
Developer technologies | .NET | .NET MAUI
Developer technologies | .NET | .NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
1 answer
Sort by: Most helpful
-
zd yu 41 Reputation points MVP
2022-12-14T12:09:00.51+00:00