slayerbulia Posted October 1, 2009 Share Posted October 1, 2009 Here is a newbee question: How can I check what all controls in the app are ready? for example then Word is starting the window with the title appears previous to the Menus and tabs. Link to comment Share on other sites More sharing options...
TurionAltec Posted October 1, 2009 Share Posted October 1, 2009 You could make the window text argument of Winwait look for something that's part of a control. This works on Word 2003: Opt("Wintitlematchmode",2) ShellExecute("winword.exe") WinWait("Microsoft Word","Menu Bar") Msgbox(0,"Found", "Found word") Alternatively, you can try getting a Control handle, and keep checking until the handle is a valid number. I put a sleep in the loop so it won't kill the CPU. I chose the main document control because toolbars may be customized: Opt("Wintitlematchmode",2) ShellExecute("winword.exe") Do Sleep (100) Until ControlGetHandle("Microsoft Word","","[CLASSNN:_WwG1]") <> "" Msgbox(0,"Found", "Found word") Link to comment Share on other sites More sharing options...
slayerbulia Posted October 1, 2009 Author Share Posted October 1, 2009 You could make the window text argument of Winwait look for something that's part of a control. This works on Word 2003: Opt("Wintitlematchmode",2) ShellExecute("winword.exe") WinWait("Microsoft Word","Menu Bar") Msgbox(0,"Found", "Found word") Alternatively, you can try getting a Control handle, and keep checking until the handle is a valid number. I put a sleep in the loop so it won't kill the CPU. I chose the main document control because toolbars may be customized: Opt("Wintitlematchmode",2) ShellExecute("winword.exe") Do Sleep (100) Until ControlGetHandle("Microsoft Word","","[CLASSNN:_WwG1]") <> "" Msgbox(0,"Found", "Found word") This message appears a moment before the Menu Bar in fact becames visible... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now