Hello folks. I am trying to open the system menu of other applications (
like right clicking on a taskbar entry - that menu ) at a position of my
choice.
I have it working while my own application is the target, but I need to do
it for other applications as well, when I try it the menu never shows up.
The code I have tryed ( and different variations ) is:
hMenuHandle := GetSystemMenu( Window.Handle, False );
TrackPopupMenu( hMenuHandle, TPM_LEFTALIGN, 25, 25, 0, Window.Handle, nil );
Window.Handle is my own variable, and is the hwnd of the window I want to
get the system menu of. I checked hMenuHandle and it has a value, so I'm
guessing that part works.
The only other option I can think to get this working is using GetMenuItem*
to rebuild the menu, which I do not want to do unless I absolutely have to.
Thank You.