tonsafun Posted July 6, 2004 Share Posted July 6, 2004 well what i am trying to do is, if a window does not match a certain title, auto it kills the window, and keeps killing windows until the title matches, but when the title matches i want it to do something else. any help is appreciated here Link to comment Share on other sites More sharing options...
ezzetabi Posted July 6, 2004 Share Posted July 6, 2004 (edited) Try this, and RTFM While 1 For c$ 1 to Int(Random(10)) Send("!{TAB}") Next If WinGetTitle("") == "The title I want" Then ;Do what I want with that window Else If WinGetTitle("") <> "Program manager" Then WinClose(WinGetTitle("")) EndIf EndIf Sleep(60000) Wend Edit: typo Edited July 6, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
tonsafun Posted July 6, 2004 Author Share Posted July 6, 2004 (edited) well this is what i wanted at the time, but now is this possible? specify certain titles and autoit only allows these window titles to be open, if a window opens with a different title, it should immediately be killed. Edited July 6, 2004 by tonsafun Link to comment Share on other sites More sharing options...
redndahead Posted July 6, 2004 Share Posted July 6, 2004 (edited) This should be simpler...I would first run the script that is posted previously to set-up all the windows that are currently opened. Here is how I would change the script: $MyTitle = "This is the title I want" While WinGetTitle("") <> "Program Manager" If WinGetTitle("") == $MyTitle Then WinSetState($MyTitle,,@SW_MINIMIZE) Else WinClose(WinGetTitle("")) EndIf Send("!{TAB}") Wend WinSetState($MyTitle,,@SW_RESTORE) While 1 $CurrentTitle = WinGetTitle("") If $CurrentTitle <> $MyTitle Then WinClose($CurrentTitle) WEnd I think this should work without any problems. red Edited July 6, 2004 by redndahead Link to comment Share on other sites More sharing options...
tutor2000 Posted July 6, 2004 Share Posted July 6, 2004 Try this, and RTFM While 1 For c$ 1 to Int(Random(10)) Send("!{TAB}") Next If WinGetTitle("") == "The title I want" Then ;Do what I want with that window Else If WinGetTitle("") <> "Program manager" Then WinClose(WinGetTitle("")) EndIf EndIf Sleep(60000) Wend Edit: typoMy over caffein stimulated slightly ADHD brain created someone's signature file Wow Rick 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