tags:

views:

18

answers:

1

Hi Folks,

Is it possible to enumerate all main menu items of other programs on Windows? How?

And how to click any of those menu items after getting the menu item list?

Thank you very much!

A: 

You can do just about anything with the Win32 API functions:

FindWindow

SendMessage

MN_GETHMENU

Cade Roux
Thank you Cade, after getting the HMENU handle after sending the MN_GETHMENU message to the target window, how to iterate though all menu items in that HMENU handle? Thank you!
Edwin
@Edwin Try GetSubMenu http://msdn.microsoft.com/en-us/library/ms647984(VS.85).aspx and have a read of this article about test automation: http://msdn.microsoft.com/en-us/magazine/cc163738.aspx
Cade Roux
thank you very much, Cade!
Edwin