I've read about how to make a notification popup menu go away when clicking outside it, but when I use the suggested code, a right click causes the taskbar popup menu to appear as well as my own. How do I make only my menu appear? Here is my code:
SetForegroundWindow(Form1.Handle);
PopupMenu1.Popup(x, y);
PostMessage(Form1.Handle, WM_NULL, 0, 0);
Edit: Okay, it seems like I did need to do something related to what I commented below.
trayhandle := FindWindow('Shell_TrayWnd', '');
trayhandle := FindWindowEx(trayhandle, 0, 'TrayNotifyWnd', nil);
trayhandle := FindWindowEx(trayhandle, 0, 'SysPager', nil);
trayhandle := FindWindowEx(trayhandle, 0, 'ToolbarWindow32', nil);
PostMessage(trayHandle, WM_LBUTTONDOWN, MK_LBUTTON, 0);
PostMessage(trayHandle, WM_LBUTTONUP, MK_LBUTTON, 0);
SetForegroundWindow(Handle);
PopupMenu1.Popup(x, y);
PostMessage(Handle, WM_NULL, 0, 0);
I've done other work and kept bouncing back to this app and the menu (and only my menu) displays properly and disappears properly as well. Seems to be working fine now (besides triggering the left mouse button)?