09-10-2009, 02:16 PM
Thank you a lot for the idea, but it looks like it is not the cause of the problem:
1. If I run this part of code WordPad it retrieves all handlers successfully
' Get the Handle of the main window. Make sure you launch wordpad.exe before you run this example (insted of folder window)
WinHandle = Window("title:=.* - WordPad", "index:=0").GetROProperty("hwnd")
2. I click on File menu (and still the problem is the same)
Window("regexpwndtitle:="&strWin).WinToolbar("regexpwndclass:=ToolbarWindow32","windowstyle:=1442895949").Press "&File"
My guess here is that the problem is because of objects hierarhy (our menu context is on the menu bar) and it seems that MenuHandle = Extern.GetMenu(WinHandle) is not the handler to the main menu.
When I try to spy the menu the handler is not the same I get from the script
What do you think about this? Will be really appreciate any thoughts.
1. If I run this part of code WordPad it retrieves all handlers successfully
' Get the Handle of the main window. Make sure you launch wordpad.exe before you run this example (insted of folder window)
WinHandle = Window("title:=.* - WordPad", "index:=0").GetROProperty("hwnd")
2. I click on File menu (and still the problem is the same)
Window("regexpwndtitle:="&strWin).WinToolbar("regexpwndclass:=ToolbarWindow32","windowstyle:=1442895949").Press "&File"
My guess here is that the problem is because of objects hierarhy (our menu context is on the menu bar) and it seems that MenuHandle = Extern.GetMenu(WinHandle) is not the handler to the main menu.
When I try to spy the menu the handler is not the same I get from the script
What do you think about this? Will be really appreciate any thoughts.