Garrett19212 Posted March 5, 2005 Share Posted March 5, 2005 Im making something for a program. When the program "Brood War" minimizes i want it to pause the program. When the program "Brood War" unminimizes i want it to unpause the program. I have a command that pauses it manually like. Global $Paused HotKeySet("^{SPACE}", "Paused") Func Paused() $Paused = NOT $Paused While $Paused sleep(100) WEnd EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2005 Developers Share Posted March 5, 2005 Im making something for a program.When the program "Brood War" minimizes i want it to pause the program.When the program "Brood War" unminimizes i want it to unpause the program.<{POST_SNAPBACK}>While BitAND(WinGetState('window title','window text'),@SW_MINIMIZE) sleep(10) WEnd SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Garrett19212 Posted March 5, 2005 Author Share Posted March 5, 2005 Its not working. I have 2 seperate programs. 1st program- the one that works with the game. 2nd program- the actually game thats running. When the 2nd program minimizes i want the 1st program to pause itself. When the 2nd program unminimizes i want the 1st program to unpause itself. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2005 Developers Share Posted March 5, 2005 Its not working.I have 2 seperate programs.1st program- the one that works with the game.2nd program- the actually game thats running.When the 2nd program minimizes i want the 1st program to pause itself.When the 2nd program unminimizes i want the 1st program to unpause itself.<{POST_SNAPBACK}>ok... and does "program 2" have a window title? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Garrett19212 Posted March 5, 2005 Author Share Posted March 5, 2005 (edited) yes the window title is brood war Edited March 5, 2005 by Garrett19212 Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2005 Developers Share Posted March 5, 2005 yes the window title is brood war<{POST_SNAPBACK}>Ummm ....made the assumption that SW_MINIMIZE= 16 but it is 6so this should work... (demo with notepad):Opt("WinTitleMatchMode", 2) Run('notepad') while 1 While BitAND(WinGetState('- Notepad',''),16) sleep(500) SplashTextOn('','Sleeping',150,50,1,1) WEnd SplashTextOn('','Running',150,50,1,1) sleep(500) WEnd SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Garrett19212 Posted March 5, 2005 Author Share Posted March 5, 2005 how woudl i add that to my program what would i change Opt("WinTitleMatchMode", 2) Run('notepad') while 1 While BitAND(WinGetState('- brood war',''),16) sleep(500) SplashTextOn('','Sleeping',150,50,1,1) WEnd SplashTextOn('','Running',150,50,1,1) sleep(500) WEnd like that? cuz it didn't work. It didnt pause or anything when i minimized it still said running and it didnt do any of the other commands i had Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2005 Developers Share Posted March 5, 2005 how woudl i add that to my program what would i changeOpt("WinTitleMatchMode", 2)Run('notepad')while 1 While BitAND(WinGetState('- brood war',''),16) sleep(500) SplashTextOn('','Sleeping',150,50,1,1) WEnd SplashTextOn('','Running',150,50,1,1) sleep(500)WEndlike that? cuz it didn't work.It didnt pause or anything when i minimized it still said running and it didnt do any of the other commands i had<{POST_SNAPBACK}>thought your windows title was: 'brood war' and not '- brood war' .. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Garrett19212 Posted March 5, 2005 Author Share Posted March 5, 2005 it works with pausing ect but it doesnt cary out my other commands Link to comment Share on other sites More sharing options...
Developers Jos Posted March 5, 2005 Developers Share Posted March 5, 2005 (edited) it works with pausing ect but it doesnt cary out my other commands<{POST_SNAPBACK}>Don't tell me you just inserted this example in your running code .... The example is to just a proof of concept.... you need to apply this concept to your own code since you are the only one that knows it.Just to show the logic:Opt("WinTitleMatchMode", 2) while 1 While BitAND(WinGetState('brood war',''),16) sleep(500) ; code to perform while minimized WEnd ; ; put here your code you want to perform while window is not minimized ; WEnd Edited March 5, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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