Monitor Power Off
#1
Guest_sbimdesign_*
Posted 04 May 2005 - 07:24 AM
People sometimes should not see how the script works etc. create special accounts or directories remotely on public terminals.
Thanks.
#2
Posted 04 May 2005 - 07:50 AM
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) WEnd
Edited by Burrup, 04 May 2005 - 07:50 AM.
#3
Posted 05 May 2005 - 05:49 PM
Great direct call script 'Burrup'
kjactive
Edited by kjactive, 05 May 2005 - 05:50 PM.
#4
Posted 06 May 2005 - 03:33 AM
Edit: Found it. http://www.autoitscript.com/forum/index.ph...topic=10831&hl= Original poster : 'Kerberuz'.
Edited by Burrup, 06 May 2005 - 03:36 AM.
#5
Posted 06 May 2005 - 07:27 AM
Au3Calibur: a excerpts manager to add usefull code into a libraries of snapped code, always at your fingertips control - no limit in amound of libraries created as to indexes included. I got a AutoIt, Html, temporary etc. - the application uses the clipboard to import/export as it can make direct interfase with SciTe and display Html directly...
Check it out - the application comes with an installer/uninstaller script and a topics included...
Download from site:
http://www.sitecenter.dk/latenight/nss-fol.../Au3Calibur.exe
kjactive
Edited by kjactive, 06 May 2005 - 07:32 AM.
#6
Posted 12 May 2005 - 06:41 PM
const $WM_SYSCommand = 274,$SC_MonitorPower = 61808,$Power_On = -1,$Power_Off = 2 $HWND=WinGetHandle(WinGetTitle("","")) Func MonitorOff() DllCall("user32.dll","int","SendMessage","hwnd",$HWND,"int",$WM_SYSCommand,"int",$SC_MonitorPower,"int",$Power_Off) EndFunc Func MonitorOn() DllCall("user32.dll","int","SendMessage","hwnd",$HWND,"int",$WM_SYSCommand,"int",$SC_MonitorPower,"int",$Power_On) EndFunc $i=0 while $i<10 $i=$i+1 MonitorOff() Sleep(5000) MonitorOn() WEnd
Is there any way to fix that?
Together we might liveDivided we must fall
#7
Posted 13 May 2005 - 02:30 AM
Once it's time to wake up, it starts a browser window and opens to a streaming radio station (WJRR, Real Rock 101.1 of Orlando, FL), but keeps turning the monitor off for another 30 minutes.
Once it is between 06:45 and 6:55, the radio station browser window will close, and a forced reboot will ensue.
I'm a high school student, so I have this as my wakeup program. I also have trouble Remote Accessing this once I'm at school, if it has been left on for more than 24 hours...that's why there's a reboot.
A bit too much code for a post...script attached.
Attached Files
_DateAdd("d", -2, _NowCalcDate())
#8
Posted 13 May 2005 - 09:24 AM
#9
Posted 10 June 2005 - 07:50 AM
^^ same question herewow, how do you learn to call the dlls? is there a tut or just experience?
#10
Posted 10 June 2005 - 01:40 PM
Func _Monitor($iNum) ; 0 = Off ; 1 = On ; failure = -1 ; success = -2 const $WM_SYSCommand = 274, $SC_MonitorPower = 61808, $Power_On = -1, $Power_Off = 2 $HWND = WinGetHandle(WinGetTitle("","")) If $iNum = 0 Then DllCall("user32.dll","int","SendMessage","hwnd",$HWND,"int",$WM_SYSCommand,"int",$SC_MonitorPower,"int",$Power_Off) If @error Then Return -1 Else Return -2 EndIf Exit ElseIf $iNum = 1 Then DllCall("user32.dll","int","SendMessage","hwnd",$HWND,"int",$WM_SYSCommand,"int",$SC_MonitorPower,"int",$Power_On) If @error Then Return -1 Else Return -2 EndIf Exit Else Return -1 Exit EndIf EndFunc; _Monitor(1)
Is it OK ?
#11
Posted 23 September 2005 - 08:29 PM
#12
Posted 23 September 2005 - 09:04 PM
_DateAdd("d", -2, _NowCalcDate())
#13
Posted 23 September 2005 - 09:22 PM
I'm thinking of a global Windows hook.....
#14
Guest_Guest_*
Posted 20 January 2008 - 08:24 AM
That fixes it turning back on. I was just doing this in VB.NET but I didn't know how to call a dll from Autoit. Sweet.
#15
Posted 20 January 2008 - 08:52 AM
Way to bump a age old topic...Just though incase anyone was searching for something like this in future reference, to activate this by a hotkey you just need to add a bit of sleep time ( Sleep(200) )
That fixes it turning back on. I was just doing this in VB.NET but I didn't know how to call a dll from Autoit. Sweet.
#16
Posted 20 January 2008 - 01:15 PM
_SendMessage in helpfile.
Mega
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users






