forever Posted July 7, 2005 Share Posted July 7, 2005 is there a way to turn the screen off for some seconds ? and turn it on then..? so a toggle or so? anyone? perhaps a 3-party-tools? Link to comment Share on other sites More sharing options...
buzz44 Posted July 7, 2005 Share Posted July 7, 2005 (edited) Opt("WinTitleMatchMode', 4) $WM_SYSCommand = 274 $SC_MonitorPower = 61808 $Power_On = -1 $Power_Off = 2 $X = 1 $HWND = WinGetHandle('classname=Progman') While 1 If $X = 1 Then $X = 0 DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, "int", _ $SC_MonitorPower, "int", $Power_Off) Else $X = 1 DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, "int", _ $SC_MonitorPower, "int", $Power_On) EndIf Sleep(10000) WEndI wrote a tidyer version of the above somewhere on the forums but can't seem to find it. The above should work.Edit: Found it...http://www.autoitscript.com/forum/index.ph...topic=11122&hl= Edited July 7, 2005 by Burrup qq Link to comment Share on other sites More sharing options...
w0uter Posted July 7, 2005 Share Posted July 7, 2005 made it into a function for you lazy nubs Func _MonitorPower($i_Power) If $i_Power <> 0 AND $i_Power <> 1 Then SetError(1) return 0 EndIf Local $ai_PowerState[2] = [2, -1] Local $i_WTMM = Opt("WinTitleMatchMode", 4) DllCall("user32.dll", "int", "SendMessage", "hwnd", WinGetHandle('classname=Progman'), "int", 274, "int", 61808, "int", $ai_PowerState[$i_Power]) Opt("WinTitleMatchMode", $i_WTMM) return 1 EndFunc ;ConsoleWrite(_MonitorPower(0) & @LF) ;Sleep(10000) ;ConsoleWrite(_MonitorPower(1) & @LF) My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll 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