WM_SYSCOMMAND & SC_MOUSEMENU
Posted on 2004-04-08
SendMessage( targetWindow, WM_SYSCOMMAND, SC_MOUSEMENU, lParam );
The documentation for SC_MOUSEMENU says "Retrieves the window menu as a result of a mouse click.". Now I know the parameters I send are correct, but it does nothing. Can someone explain why it doesnt work? Or possibly explain how I could get it to work?
Additionally, while watching with Spy++, when a window normally gets a WM_SYSCOMMAND and SC_MOUSEMENU it is only sent and theres no matching return. When I send the message it is send and and returned always.
Alternatively I will give points to any technique that will open a menubar item normally givin the items screen position, ie not getting the submenu and calling TrackPopupMenu, but allowing the OS to handle it normally as if it was clicked with a mouse ( btw, the mouse is not actually over the item ).