I think this might be a bug in GetMenuItemInfo
- I was playing around with an Application we have, and I was using the
menu commands in Win32:GuiTest 1.50.5. I am new at all this so I could
be mistaken, but here is what I found.
The app has a bunch of menus and submenus, and I was using the "text"
key in the hash returned by GetMenuItemInfo to grab the text of the
MenuItem. This worked for everything except one menu in the app. I
couldnt figure out what was wrong so I went to the developer and we
looked at the app in Visual C++. We noticed that the only difference
in these MenuItems was that they had a flag set called "Help". The
Help flag was described as something like "Right-Justifies the Menu
Item when it is part of the topmost menu. It looks like its intended
for a Help menu being on the right side of the screen instead of the
left like File, Edit, etc. It has no purpose for MenuItems in a
submenu but it still lets you set it.
So the developer made a test app with a submenu and every other
MenuItem set with the Help flag on. Here is what happens:
I assign the GetMenuItemInfo hash to an array and print the array...
For a MenuItem in a submenu without the Help flag set:
fstate 0 text &New Ctrl+N type string ftype 0
For a MenuItem in a submenu with the Help flag set:
fstate 0 type unknown ftype 16384
So the text key is completely missing.
Is this a bug in GetMenuItemInfo? (even though it makes no sense to
enable the help flag anyway)