Geethu Posted April 23, 2014 Share Posted April 23, 2014 Hi, Now I want to get the Window Handle of a popup window. My problems are : 1. It doesn't have a title and its class is same for the opened window other than popup window. So, when using the class name I got the handle of previous opened window. 2. The popup window is opened after a short time by clicking a button. And the time is not always same for all the button click. So I can't access the active window after some sleep time. I have to read the text contained in the Popup window. Its control informations are : Class : WindowsForms10.STATIC.app.0.37504c8_r92_ad2 Instance : 1 ClassnameNN : WindowsForms10.STATIC.app.0.37504c8_r92_ad21 Name : lblMessage Advanced Mode : [NAME:lblMessage] ID : 788142 Text : successfully completed Thanks in advance. Link to comment Share on other sites More sharing options...
Exit Posted April 23, 2014 Share Posted April 23, 2014 (edited) Perhaps While 1 $hPopup = (WinWait("[Class:WindowsForms10.STATIC.app.0.37504c8_r92_ad21]", "successfully completed", 1) ? (WinActivate("[LAST]") ? WinWaitActive("[LAST]") : 0) : SetError(1, 0, 0)) If Not @error Then ExitLoop WEnd See also here Edited April 23, 2014 by Exit App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Geethu Posted April 23, 2014 Author Share Posted April 23, 2014 (edited) Thank you for your effort. Its not working for me. The text successfully completed is contained in a label field and the label is contained in the popup window. When using the above code it returns 0. The popup window doesn't have a Class or any control information. Above given details are of the Label field. I have to read the content "successfully completed". What to do? Edited April 23, 2014 by Geethu Link to comment Share on other sites More sharing options...
JohnOne Posted April 23, 2014 Share Posted April 23, 2014 Just because it's in a label does not mean it's not window text. Show the whole info from summary tab of window info tool. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Geethu Posted April 23, 2014 Author Share Posted April 23, 2014 Here is the complete information when selecting label field. >>>> Window <<<< Title: Class: WindowsForms10.Window.8.app.0.37504c8_r92_ad2 Position: 809, 481 Size: 302, 158 Style: 0x16800000 ExStyle: 0x00050109 Handle: 0x00030C20 >>>> Control <<<< Class: WindowsForms10.STATIC.app.0.37504c8_r92_ad2 Instance: 1 ClassnameNN: WindowsForms10.STATIC.app.0.37504c8_r92_ad21 Name: lblMessage Advanced (Class): [NAME:lblMessage] ID: 134186 Text: successfully completed Position: 8, 48 Size: 280, 64 ControlClick Coords: 141, 29 Style: 0x5600000D ExStyle: 0x00000000 Handle: 0x00020C2A >>>> Mouse <<<< Position: 961, 561 Cursor ID: 0 Color: 0xF0F0F0 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< OK successfully completed >>>> Hidden Text <<<< Link to comment Share on other sites More sharing options...
Exit Posted April 23, 2014 Share Posted April 23, 2014 While 1 $hPopup = (WinWait("[Class:WindowsForms10.Window.8.app.0.37504c8_r92_ad2]", "successfully completed", 1) ? (WinActivate("[LAST]") ? WinWaitActive("[LAST]") : 0) : SetError(1, 0, 0)) If Not @error Then ExitLoop WEnd App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
jdelaney Posted April 23, 2014 Share Posted April 23, 2014 Exit, you can't use class...that changes each time...you'd have to use RegExpClass, or the NAME. I also like using _WinAPI_GetWindow Option 6...you pass in the parent handle, and it will send back the handle of the enabled popup...may or may not work with that specific class of window, but a good one to check. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. 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