Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Nov : Open another application's popup menu.

www.cryer.info
Managed Newsgroup Archive

Open another application's popup menu.

Subject:Open another application's popup menu.
Posted by:"Andrew MacIntyre" (andrewm..@gmail.com)
Date:Wed, 9 Nov 2005 15:44:28 -0400

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.

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive