The target app is written in Delphi (win32 not .NET) and is closed-source.
The action I want to invoke is called Copy, but there is no obvious keyboard shortcut. (Ctrl+Insert does the wrong thing and Ctrl+C does nothing)
I can find my target HWND
and persuade it to open the context menu (it responds to WM_RBUTTONDOWN/UP
not WM_CONTEXTMENU
). From the menu HWND
I can even obtain the menu handle via MN_GETHMENU
and find the menu item I want. I just don't know the details of how to "choose" the item. It doesn't help that the menu is "modeless", ie. its HWND
is not owned, so I don't know which of many hidden TPUtilWindow
windows is the real owner - otherwise I could probably just send it a WM_COMMAND
and not even pop up the menu, which would be preferable.
Although I am sure it facilitates all sorts of hacks, I would prefer not to inject code into the target process.
Answers accepted in any language.