|
-
Sep 8th, 2001, 03:44 PM
#1
Thread Starter
New Member
Power Off Monitor?
Hello, I have a question about powering off the monitor. I have searched Microsoft's API site, and searched the entire Internet. There must be some C++ API structure/function that permits a user to power off the monitor. I have written programs in the past to power off the CPU, and I wanted to power the monitor off as well. Any information about this would be appreciated, thanks.
-Tom-
-
Sep 9th, 2001, 10:49 AM
#2
New Member
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MONITORPOWER = &HF170
'''Turn Off The Monitor
SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal 0&
'''Turn On The Monitor
SendMessage Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal -1&
Good Luck
-cl
-
Sep 10th, 2001, 11:40 AM
#3
I tried this code, and the only thing that happened was my monitor went black.
The power button was still on. I physically turned the monitor off at that point, and turned it back on, but nothing happened.
I had to cold boot my machine to get my monitor back.
-
Sep 10th, 2001, 11:41 AM
#4
Oops. I hit the submit button before I wanted to.
I was going to say, that perhaps this code only works with certains kinds of monitors. I have a DELL.
-
Sep 10th, 2001, 04:49 PM
#5
Fanatic Member
Originally posted by Hack
Oops. I hit the submit button before I wanted to.
I was going to say, that perhaps this code only works with certains kinds of monitors. I have a DELL.
I tried it with my Compaq 171FS and it just went into suspend mode. Power still on.
When you test something like this, use a timer to turn it back on.
-
Sep 13th, 2001, 10:05 AM
#6
The timer thing is good advice. I learned that the hard way.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|