GodandRock Posted April 15, 2006 Share Posted April 15, 2006 (edited) Hello. I was thinking and I got an idea. You know when you set a timer for your monitor to turn off in Win XP, it turns off if you're idle for that long. I was thinking, this is software related. So is there a way in AutoIt so that you can turn off the monitor? Second idea is the mouse disappearing. Like when you're watching a movie on your computer. Certain programs make your mouse disappear after idling for a few seconds. So is there a way you can make the mouse disappear using AutoIt? Thank you. <<<------------ YAY! 50'th post! Edited April 15, 2006 by GodandRock [font="Fixedsys"][size="3"][u][font="Franklin Gothic Medium"] [/font][/u][/size][/font] Link to comment Share on other sites More sharing options...
greenmachine Posted April 15, 2006 Share Posted April 15, 2006 (edited) Monitor Toggle: MonitorToggle(1) Sleep (20000) MonitorToggle(0) Func MonitorToggle($Off = 1) $opt = Opt("WinTitleMatchMode", 4) $WM_SYSCommand = 274 $SC_MonitorPower = 61808 $Power_Off = 2 $Power_On = -1 $HWND = WinGetHandle("classname=Progman") If $Off Then DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, _ "int", $SC_MonitorPower, "int", $Power_Off) Else DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, _ "int", $SC_MonitorPower, "int", $Power_On) EndIf Opt ("WinTitleMatchMode", $opt) EndFunc Hide cursor (only while over GUI): GUICreate ("cursor") GUISetState () DllCall("user32.dll", "int", "ShowCursor", "int", 0);HIDE CURSOR Sleep (10000) DllCall("user32.dll", "int", "ShowCursor", "int", 1);SHOW CURSOR Sleep (1000) P.S. - it helps to search. Edited April 15, 2006 by greenmachine Link to comment Share on other sites More sharing options...
GodandRock Posted April 16, 2006 Author Share Posted April 16, 2006 Wow dude thanks a lot. Thats pretty cool. Also, can the GUI be in @SW_HIDE mode and it still works? [font="Fixedsys"][size="3"][u][font="Franklin Gothic Medium"] [/font][/u][/size][/font] Link to comment Share on other sites More sharing options...
greenmachine Posted April 17, 2006 Share Posted April 17, 2006 Something I just noticed - GUISetCursor(16) does the same thing (hides the cursor). And no, it has to be showing - only while the cursor is over a visible GUI does it work. Link to comment Share on other sites More sharing options...
ihenvyr Posted April 17, 2006 Share Posted April 17, 2006 (edited) Monitor Toggle: MonitorToggle(1) Sleep (20000) MonitorToggle(0) Func MonitorToggle($Off = 1) $opt = Opt("WinTitleMatchMode", 4) $WM_SYSCommand = 274 $SC_MonitorPower = 61808 $Power_Off = 2 $Power_On = -1 $HWND = WinGetHandle("classname=Progman") If $Off Then DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, _ "int", $SC_MonitorPower, "int", $Power_Off) Else DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, _ "int", $SC_MonitorPower, "int", $Power_On) EndIf Opt ("WinTitleMatchMode", $opt) EndFunc Hide cursor (only while over GUI): GUICreate ("cursor") GUISetState () DllCall("user32.dll", "int", "ShowCursor", "int", 0);HIDE CURSOR Sleep (10000) DllCall("user32.dll", "int", "ShowCursor", "int", 1);SHOW CURSOR Sleep (1000) P.S. - it helps to search. hello!! i just wanna ask if it works for TV as monitor?? is there a way to turn of TV as well? or any recommendations? thanks... Edited April 17, 2006 by ihenvyr Umbrella Member Link to comment Share on other sites More sharing options...
CyberSlug Posted April 18, 2006 Share Posted April 18, 2006 (edited) Attempt to hide mouse. Requires Win 2000/XP for WinSetTrans to work. Press Escape to exit the script. #include <GuiConstants.au3> HotKeySet("{Esc}", "Quit") Func Quit() Exit EndFunc $MyGUI = GuiCreate("",@DesktopWidth+9, @DesktopHeight+9, -9, -9, BitOR($WS_POPUP, $WS_DLGFRAME)) GuiSetBkColor(0x0) GuiSetState() WinSetOnTop($MyGUI, "", 1) WinSetTrans($MyGUI, "", 1);almost transparent; opacity value of 0 doesn't hide mouse GuiSetCursor(16) While 1 sleep(10) $mouse = GUIGetCursorInfo() If @error Then ContinueLoop ; Attempt to pass on mouse clicks just for fun (not required) If $mouse[2] Then;primary down winSetState($MyGui, "", @SW_HIDE) MouseClick("primary", $mouse[0], $mouse[1]) winSetState($MyGui, "", @SW_SHOW) ElseIf $mouse[3] Then;right-click winSetState($MyGui, "", @SW_HIDE) MouseClick("secondary", $mouse[0], $mouse[1]) winSetState($MyGui, "", @SW_SHOW) EndIf Wend Edited April 18, 2006 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
ihenvyr Posted April 18, 2006 Share Posted April 18, 2006 (edited) Attempt to hide mouse. Requires Win 2000/XP for WinSetTrans to work. Press Escape to exit the script. #include <GuiConstants.au3> HotKeySet("{Esc}", "Quit") Func Quit() Exit EndFunc $MyGUI = GuiCreate("",@DesktopWidth+9, @DesktopHeight+9, -9, -9, BitOR($WS_POPUP, $WS_DLGFRAME)) GuiSetBkColor(0x0) GuiSetState() WinSetOnTop($MyGUI, "", 1) WinSetTrans($MyGUI, "", 1);almost transparent; opacity value of 0 doesn't hide mouse GuiSetCursor(16) While 1 sleep(10) $mouse = GUIGetCursorInfo() If @error Then ContinueLoop ; Attempt to pass on mouse clicks just for fun (not required) If $mouse[2] Then;primary down winSetState($MyGui, "", @SW_HIDE) MouseClick("primary", $mouse[0], $mouse[1]) winSetState($MyGui, "", @SW_SHOW) ElseIf $mouse[3] Then;right-click winSetState($MyGui, "", @SW_HIDE) MouseClick("secondary", $mouse[0], $mouse[1]) winSetState($MyGui, "", @SW_SHOW) EndIf Wend thanks you very much.. but this: MonitorToggle(1) Sleep (5000) MonitorToggle(0) Func MonitorToggle($Off = 1) $opt = Opt("WinTitleMatchMode", 4) $WM_SYSCommand = 274 $SC_MonitorPower = 61808 $Power_Off = 2 $Power_On = -1 $HWND = WinGetHandle("classname=Progman") If $Off Then DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, _ "int", $SC_MonitorPower, "int", $Power_Off) Else DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, _ "int", $SC_MonitorPower, "int", $Power_On) EndIf Opt ("WinTitleMatchMode", $opt) EndFunc is there a way to turn of TV as well? -if i use TV as my monitor.. or to turn TV display to black? any recommendations? thanks... Edited April 18, 2006 by ihenvyr Umbrella Member Link to comment Share on other sites More sharing options...
dnsi Posted April 18, 2006 Share Posted April 18, 2006 Cool it works! My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture Link to comment Share on other sites More sharing options...
ihenvyr Posted April 18, 2006 Share Posted April 18, 2006 is there a way to turn of TV as well? -if i use TV as my monitor.. or to turn TV display to black? any recommendations? thanks... Umbrella Member Link to comment Share on other sites More sharing options...
GodandRock Posted April 18, 2006 Author Share Posted April 18, 2006 ihenvyr, you are spamming dude. We all read you the first time, if someone wants to help you out they will, no need to spam. [font="Fixedsys"][size="3"][u][font="Franklin Gothic Medium"] [/font][/u][/size][/font] Link to comment Share on other sites More sharing options...
jacksont123 Posted May 9, 2006 Share Posted May 9, 2006 Monitor Toggle: MonitorToggle(1) Sleep (20000) MonitorToggle(0) Func MonitorToggle($Off = 1) $opt = Opt("WinTitleMatchMode", 4) $WM_SYSCommand = 274 $SC_MonitorPower = 61808 $Power_Off = 2 $Power_On = -1 $HWND = WinGetHandle("classname=Progman") If $Off Then DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, _ "int", $SC_MonitorPower, "int", $Power_Off) Else DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, _ "int", $SC_MonitorPower, "int", $Power_On) EndIf Opt ("WinTitleMatchMode", $opt) EndFunc is there a way to make it so: you turn it off via hotkey, you can't turn it back on by moving the mouse, but you can turn it back by pressing that hotkey again (toggle) thanks Link to comment Share on other sites More sharing options...
jacksont123 Posted May 10, 2006 Share Posted May 10, 2006 bump 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