qatony Posted April 16, 2008 Share Posted April 16, 2008 Hi all, I am trying to automatically close an update prompt window that pops up everytime I started an application I purchased with the following code. The problem is that the update prompt window has an empty title. I am able to use this code to close #32770 windows with any title, but it seems like it does not work properly for window that has empty title. Could somebody please suggest a way to close a window with empty title or show me how I can modify the existing code to successfully match empty title window? I have also attached the window info I got from AutoIt info tool with this thread. Please help, I am running out of ideas. Thanks in advance. While 1 If WinWait("[CLASS:#32770]", "", 2) Then ConsoleWrite("Debug: Detected update prompt window" & @LF) $hWin = WinGetHandle("[CLASS:#32770]","") WinActivate($hWin) ExitLoop Else ConsoleWrite("Debug: Update prompt window not detected yet..." & @LF) EndIf WEnd Sleep(500) ControlClick($hWin, "", "[CLASS:Button;TEXT:No]") >>>> Window <<<< Title: Class: #32770 Position: 242, 402 Size: 389, 131 Style: 0x9600004C ExStyle: 0x00010000 Handle: 0x000D07F0 >>>> Control <<<< Class: Instance: ClassnameNN: ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: 0x00010C8A Link to comment Share on other sites More sharing options...
rasim Posted April 16, 2008 Share Posted April 16, 2008 Hi and wellcome! Mayb this window have a text, mayb a hidden text? Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 16, 2008 Share Posted April 16, 2008 Hi all, I am trying to automatically close an update prompt window that pops up everytime I started an application I purchased with the following code. The problem is that the update prompt window has an empty title. I am able to use this code to close #32770 windows with any title, but it seems like it does not work properly for window that has empty title. Could somebody please suggest a way to close a window with empty title or show me how I can modify the existing code to successfully match empty title window? I have also attached the window info I got from AutoIt info tool with this thread. Please help, I am running out of ideas. Thanks in advance. While 1 If WinWait("[CLASS:#32770]", "", 2) Then ConsoleWrite("Debug: Detected update prompt window" & @LF) $hWin = WinGetHandle("[CLASS:#32770]","") WinActivate($hWin) ExitLoop Else ConsoleWrite("Debug: Update prompt window not detected yet..." & @LF) EndIf WEnd Sleep(500) ControlClick($hWin, "", "[CLASS:Button;TEXT:No]") >>>> Window <<<< Title: Class: #32770 Position: 242, 402 Size: 389, 131 Style: 0x9600004C ExStyle: 0x00010000 Handle: 0x000D07F0 >>>> Control <<<< Class: Instance: ClassnameNN: ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: 0x00010C8A The #32770 class is used for a lot of Windows system prompts and dialogs. Closing things on just that parameters could have undesirable effects. Much better to get something unique to look for. As rasim already posted, including some unique text is the easiest option. Another way to differentiate a window like that is the controls it contains. Test if for a Button control that contains the text "OK", "&Next", or "Finish" for example. There are lots of options for reliably specifying the correct window. Note the current Beta (3.2.11.7) includes advanced matching parameters for X, Y, W, H if that's all you know. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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