Jump to content

Script For Monitor


Recommended Posts

I was wondering if there is a command for the monitor instead of manually shutting off and on.

you guys maybe wondering why I would need this command, it's because im making a program that controls everything, and plus I broke my monitor reasonly and I have to use a pen to turn it on and off :mellow::) lol, but im getting a new monitor soon

Thanks in advance
Link to comment
Share on other sites

I was wondering if there is a command for the monitor instead of manually shutting off and on.

you guys maybe wondering why I would need this command, it's because im making a program that controls everything, and plus I broke my monitor reasonly and I have to use a pen to turn it on and off :mellow::) lol, but im getting a new monitor soon

#include <Misc.au3>
Const $WM_SYSCommand = 274, $SC_MonitorPower = 61808, $Power_On = -1, $Power_Off = 2
$dll = DllOpen("user32.dll")
$HWND = WinGetHandle(WinGetTitle("", ""))
DllCall($dll, "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, "int", $SC_MonitorPower, "int", $Power_Off)
Link to comment
Share on other sites

One way; but it might cause your script to not fully work....

EDIT: BlockInput might not fully work this way after all.... There is sometimes a setting in the device manager for the mice and keyboard giving you an option of whether those devices can bring your computer out of standby. My keyboard is set to bring comptuer out of standby, but my mouse is not. If I use BlockInput, I can move the mouse without making the monitor turn back on; but pressing any key turns on the monitor.

Running, XP Pro sp2 by the way.

; Press Ctrl+Alt+Delete to reactivate

#include <Misc.au3>
Const $WM_SYSCommand = 274, $SC_MonitorPower = 61808, $Power_On = -1, $Power_Off = 2
$dll = DllOpen("user32.dll")
$HWND = WinGetHandle(WinGetTitle("", ""))
DllCall($dll, "int", "SendMessage", "hwnd", $HWND, "int", $WM_SYSCommand, "int", $SC_MonitorPower, "int", $Power_Off)

BlockInput(1)
While 1
   sleep(100)
Wend
Edited 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...