PHP Code:
#include <SendMessage.au3>
if $cmdline [0] = "" then exit
_Main($cmdline[1],$cmdline[2])
Func _Main($a,$l)
Local Const $Off = 2, $On = -1
Opt("WinTitleMatchMode", 4)
$hwnd = WinGetHandle('classname=Progman')
if $a = "off" Then
$i=1
while $i = 1
sleep (1000)
_ToggleMonitor($hWnd, $Off)
$l=$l-1
if $l=0 then $i=0
WEnd
_ToggleMonitor($hWnd, $On)
EndIf
if $a = "on" Then
_ToggleMonitor($hWnd, $On)
EndIf
EndFunc
Func _ToggleMonitor($hwnd, $OnOff)
Local Const $WM_SYSCOMMAND = 274
Local Const $SC_MONITORPOWER = 61808
_SendMessage ($hWnd, $WM_SYSCOMMAND, $SC_MONITORPOWER, $OnOff)
If @error Then
MsgBox(0,"_ToggleMonitor", "_SendMessage Error: " & @error)
Exit
EndIf
EndFunc
Mach ma :)