sometimes, you may find the menu items on a PopUp menu are not
entirely identical to the Main Menu Bar items....
It is not important that I be able to display the PopUp menu, simply
obtain a HMENU to it, and then whatever SubMenu HMENU's I might
need to execute its options...
ANYONE ever try to do this? I feel it must be possible to do this
from another application, purely programmatically, and finding out how
will be very rewarding.
THANKS!
04-08-01B
email: rads...@juno.com
http://members.tripod.com/~RadSurfer/
Join us on Yahoo at:
http://groups.yahoo.com/group/BorlandCPPBuilder
for informal discussions about all versions of C++Builder...
[Computer programming for Windows 95, and Console32]
(you must be a Yahoo member to join)
In most cases it's impossible to obtain context menu without it showing, as
often such menus are built on the fly, and there is no general
implementation way, which every application has to use.
You can either set Active Accessibility hook (SetWinEventHook) and handle
EVENT_SYSTEM_MENU_XXX events or set windows hook (SetWindowsHook) and
process WM_INITPOPUPMENU messages; then you get access to menu items throw
IAccessible interface or HMENU handle appropriate.
The Active Accessibility runtime is not supplied with older Windows, so you
need add it to installation. But AA is richer than standard WM_INITPOPUPMENU
hooking. Many applications use owner draw menus or it own menu
implementation, so you are unable to get access to menu data throw HMENU
(sometimes it doesn't use HMENU at all), only IAccessible allows it (of
course if app supports it), IIRC windows start menus and VC++ 6.0 IDE menus
are non-standard things...
We did such things few years ago, and I don't now remember all details, but
you can investigate Windows/application by yourself with Spy++ or Accevent
tool from AA SDK, it's even interesting to see work under the hood...
Just in case here is the homepage for Active Accessibility technologies
http://www.microsoft.com/enable/
Cheers,
Vadim.