| || |
Getting the app\'s menu state
I'm trying to get the state of a menu item in my AUT. Specifically I want to know (during script runtime) if the item is grayed out. I'm primarily using the Win32 functions for working with the menu (GetMenu, GetMenuItemCount, etc) using the Extern.Declare keywords. I've tried using the GetMenuState function, but no luck (MF_ENABLE, MF_GRAYED, MF_DISABLED all return -1 even on active menu items).
My definition of the get menu state method is:
Extern.Declare micInteger,"GetMenuState","user32.dll","GetMenuSta te",micHwnd,micInteger,micInteger
I'm also open to using the QTP functions so any comments would be appreciated.
Re: Getting the app\'s menu state
I solved my own problem...here's what I found using QTP:
VbWindow(ORLib).WinMenu("Menu").GetItemProperty(Ma inMenuVal & ";" & MenuSubVal, "Enabled") 'returns true/false