Application Menu Iteration
-
Hi all, I'm looking at trying to write an application to iterate through all the menus in an application. Basically, this would form part of a test suite type of thing that I could build on for my applications. I also thought it would be useful as a kind of demo tool to automate actions and so wanted to make it as generic as possible (ie: just using Win32 commands to analyze the application). I need to be able to iterate through a running application because the menus may be dynamically altered at startup (this happens in our apps), so iterating through the resources of the exe is not good enough. This is all pretty easy for standard apps where the menu is not dockable, but GetMenu(HWND) doesn't appear to work on MS Apps as the menu is off sub windows etc... So far, I've been unable to figure out a way to automatically recognize the menu for these apps. We've tried sending an ALT-F message to the windows in the app to get it to popup the File menu, but that only seems to work in the standard menu apps too. Has anyone done this before?, or have any ideas on how to recognise a window with the main menu? Paul All round software nice guy....
-
Hi all, I'm looking at trying to write an application to iterate through all the menus in an application. Basically, this would form part of a test suite type of thing that I could build on for my applications. I also thought it would be useful as a kind of demo tool to automate actions and so wanted to make it as generic as possible (ie: just using Win32 commands to analyze the application). I need to be able to iterate through a running application because the menus may be dynamically altered at startup (this happens in our apps), so iterating through the resources of the exe is not good enough. This is all pretty easy for standard apps where the menu is not dockable, but GetMenu(HWND) doesn't appear to work on MS Apps as the menu is off sub windows etc... So far, I've been unable to figure out a way to automatically recognize the menu for these apps. We've tried sending an ALT-F message to the windows in the app to get it to popup the File menu, but that only seems to work in the standard menu apps too. Has anyone done this before?, or have any ideas on how to recognise a window with the main menu? Paul All round software nice guy....
MS Office 'menus' are not menus at all- they use custom window classes (MsoCommandBar) to implement "cool" look and docking. The only reference I've found in MSDN is in AccessibleObjectFromWindow docs located in Platform SDK: Accessibility - it seems that you can get a IDispatch interface for a command bar. Tomasz Sowinski -- http://www.shooltz.com