narciso Posted May 25, 2007 Share Posted May 25, 2007 My AutoIt program operates on windows of another application. The application opens many windows and some of them generate their own native dialog boxes or message boxes that have identical titles. While my script is joggling the windows some new may be opened by the main application also with their msgboxes. Many a time I must get on top of the screen the message box generated by a specific window and not just any window. How do I know that a message box has been generated by the Window1 and not by the Window2, again if simultaneously there are the two message boxes of the identical titles? If I could detect the origin of the message box or in other words determine the relation to its "parent" window... Warmly,Narciso Link to comment Share on other sites More sharing options...
PaulIA Posted May 25, 2007 Share Posted May 25, 2007 My AutoIt program operates on windows of another application. The application opens many windows and some of them generate their own native dialog boxes or message boxes that have identical titles. While my script is joggling the windows some new may be opened by the main application also with their msgboxes. Many a time I must get on top of the screen the message box generated by a specific window and not just any window. How do I know that a message box has been generated by the Window1 and not by the Window2, again if simultaneously there are the two message boxes of the identical titles? If I could detect the origin of the message box or in other words determine the relation to its "parent" window...Download Auto3Lib and run this in SciTE: #include <A3LWinAPI.au3> Send("!F") Send("a") $hWnd = WinGetHandle("Save File") ConsoleWrite("Save File handle .: " & $hWnd & @CR) $hParent = _API_GetParent($hWnd) ConsoleWrite("Parent handle ....: " & $hParent & @CR) ConsoleWrite("Parent caption ...: " & _API_GetWindowText($hParent) & @CR) Auto3Lib: A library of over 1200 functions for AutoIt 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