Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Obtaining HMENU of a floating PopUp???

1 view
Skip to first unread message

Radical NetSurfer

unread,
Apr 8, 2001, 7:38:08 AM4/8/01
to
Does anyone know the procedure for finding the HMENU for dynamically
created PopUp context-sensitive/floating menu's in Windows32
applications?
I am running a Builder appilcation which can obtain the Handles for
the Window, and Controls of _other_ currently running programs....
I want to be able to access options(menu items) that appear on the
PopUp menu's and NOT just the main-menu items (which I can already
do properly).

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)

Vadim Melnik

unread,
Apr 8, 2001, 9:20:13 AM4/8/01
to
Hello,

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.


0 new messages