AaronBaird Posted January 18, 2010 Share Posted January 18, 2010 (edited) Hi everyone, first post! First off, I dont have any coding experience. I have just kinda been searching the help file until i find what im looking for. It has worked pretty good up until now. Heres what im trying to do: I have a windows 7 Media Center dedicated machine in my living room. I need to switch the resolution to 720x480 when the process HuluDesktop.exe is running (slow machine ), and switch back to 1280x720 when it is not. Here is what I have written: It was meant to run at startup and remain a background process at all times. ; $Res is 720 if 720p and 480 if 480p $Res=Int(720) Sleep(60000); wait for windows media center to start Do if ProcessExists( "HuluDesktop.exe") And $Res=720 then ;if hulu is running and screen resolution is 720p then send("^!4") ;change resolution to 480p via hotkey $Res=Int(480) ;and make $Res reflect 480p EndIf If ProcessExists("HuluDesktop.exe")=0 and $Res=480 Then ;if hulu isnt running and screen resolution is 480p then send("^!7") ;change resolution to 720p via hotkey $Res=Int(720) ;and make $Res reflect 720p EndIf Until ProcessExists("ehshell.exe") ;windows media center process So, it works great. But Hulu Desktop stutters nonstop because this script is eating up all of my CPU (99%). If i put a sleep command in the loop it is better, but it still stutters everytime the loop runs again and the CPU useage jumps up to 100%. Do you guys know of a better way to do this? Edited January 18, 2010 by AaronBaird Link to comment Share on other sites More sharing options...
Developers Jos Posted January 18, 2010 Developers Share Posted January 18, 2010 Add the following line in the loop: Sleep(10) 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