Automationuser Posted August 29, 2013 Share Posted August 29, 2013 Hello, I am trying to close a window with title something like "Hello All - ABC" and "Hello All - A1515" i tried using many regexp, but no luck WinClose("[REGEXPTITLE:(?i).*?Hello All -.*?]") Need little help.. Link to comment Share on other sites More sharing options...
JohnOne Posted August 29, 2013 Share Posted August 29, 2013 I'm regexp dullard but this could help. Opt("WinTitleMatchMode", 2) WinClose("Hello All") 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...
FireFox Posted August 29, 2013 Share Posted August 29, 2013 (edited) Hi, Try this: WinClose("[REGEXPTITLE:(?i)Hello All - (.*?)]") Br, FireFox. Edited August 29, 2013 by FireFox Link to comment Share on other sites More sharing options...
Automationuser Posted August 29, 2013 Author Share Posted August 29, 2013 Opt("WinTitleMatchMode", 2) WinClose("Hello All") I tried this. But din't work Link to comment Share on other sites More sharing options...
Automationuser Posted August 29, 2013 Author Share Posted August 29, 2013 @Firefox, Nope. That dint work too. Link to comment Share on other sites More sharing options...
FireFox Posted August 29, 2013 Share Posted August 29, 2013 Very descriptive to say it does not work. Please use autoit tags to post your code. Can you paste here the window title using the info tool? Br, FireFox. Link to comment Share on other sites More sharing options...
Automationuser Posted August 29, 2013 Author Share Posted August 29, 2013 Here is the window title from the info tool Title: Hello All - ABC Class: #32770 Position: 368, 293 Size: 607, 244 Style: 0x14CE0044 ExStyle: 0x00010100 Handle: 0x00000000001D0DC4 Link to comment Share on other sites More sharing options...
FireFox Posted August 29, 2013 Share Posted August 29, 2013 What does this ouput? ConsoleWrite(WinGetHandle("[REGEXPTITLE:Hello All - (.*?)]") & @CrLf) ConsoleWrite(WinGetHandle("[TITLE:Hello All - ABC;CLASS:#32770]") & @CrLf) Link to comment Share on other sites More sharing options...
FireFox Posted August 29, 2013 Share Posted August 29, 2013 Maybe the window does not handle the close message, try WinKill instead. Br, FireFox. Link to comment Share on other sites More sharing options...
Automationuser Posted August 29, 2013 Author Share Posted August 29, 2013 Those two lines fetches the following : 0x00320E82 0x001D0DC4 Second output is the correct handle of the window Link to comment Share on other sites More sharing options...
Mat Posted August 29, 2013 Share Posted August 29, 2013 So there is another window on the desktop with a similar title? AutoIt Project Listing Link to comment Share on other sites More sharing options...
FireFox Posted August 29, 2013 Share Posted August 29, 2013 (edited) So try this:AutoItSetOption("WinTitleMatchMode", 2) WinClose("[TITLE:Hello All - ;CLASS:#32770]")Br, FireFox. Edited August 29, 2013 by FireFox Link to comment Share on other sites More sharing options...
Automationuser Posted August 29, 2013 Author Share Posted August 29, 2013 @Mat : Nope, there is no other window on the desktop with a similar title. @Firefox : No luck with the below code. AutoItSetOption("WinTitleMatchMode", 2) WinClose("[TITLE:Hello All - ;CLASS:#32770]") Link to comment Share on other sites More sharing options...
Mat Posted August 29, 2013 Share Posted August 29, 2013 @Mat : Nope, there is no other window on the desktop with a similar title So what does WinGetTitle return for the incorrect handle? AutoIt Project Listing Link to comment Share on other sites More sharing options...
JohnOne Posted August 29, 2013 Share Posted August 29, 2013 $Hwnd = WinGetHandle("[TITLE:Hello All - ABC;CLASS:#32770]") WinClose($HWND) 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...
Automationuser Posted August 29, 2013 Author Share Posted August 29, 2013 WinGetTitle returns 0 WinGetTitle("[TITLE:Hello All - ;CLASS:#32770]") Link to comment Share on other sites More sharing options...
Starg Posted August 29, 2013 Share Posted August 29, 2013 What if you add #RequireAdmin to the script? Link to comment Share on other sites More sharing options...
Mat Posted August 29, 2013 Share Posted August 29, 2013 WinGetTitle returns 0 WinGetTitle("[TITLE:Hello All - ;CLASS:#32770]") I meant this: ConsoleWrite(WinGetTitle(WinGetHandle("[REGEXPTITLE:Hello All - (.*?)]")) & @CrLf) AutoIt Project Listing Link to comment Share on other sites More sharing options...
FireFox Posted August 29, 2013 Share Posted August 29, 2013 What if you add #RequireAdmin to the script?It does not make sense here. Link to comment Share on other sites More sharing options...
Automationuser Posted August 29, 2013 Author Share Posted August 29, 2013 ConsoleWrite(WinGetTitle(WinGetHandle("[REGEXPTITLE:Hello All - (.*?)]")) & @CrLf) This is really weird. I have opened "Hello All - ABC" window. But WinGetTitle fetches the title of :Hello All - A1515 window which is not active. I cross checked again. 'Hello All - A1515' window is inactive. 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