Greetings, I am trying to access the Navision (Attain 3.01A) menu system through a VB6 application. I can access Navision’s windows and get handles to the main menu bar & menus. However, this is where I get stuck insofar that I have been unable to access Navision’s submenus. The attached VB code will iterate through an application’s menu recursively, so that each menu gets listed, then that menu’s submenus etc. And this works fine for most applications (I’ve tried Notepad & a few others), but for some reason Navision refuses to enumerate its submenus. Are there any programmers out there who know (or could guess) why this would occur? Or even better, know what to do about it? Thanking you. andre ps: Since I’m not allowed to upload text files (why not?) here’s a pseudo-code-ish snippet to give you an idea:
Sub ListNavisionMenuStructure() Dim hWnd As Long, hMenu As Long, hSubMenu As Long hWnd = GetApplicationHandle("Navision") hMenu = GetMenuHandle(hWnd) IterateMenus(hMenu) End Sub
I’ll email the code (as txt file) on request.