|
-
Oct 1st, 2001, 03:01 AM
#1
Thread Starter
New Member
Monitor Turn Off
Dear Sir
I am glad to send you my question which may help in finding a solution.
I am the admin. of a Software Eng. company, but we are using Unix platform, and I am not an expert in Windows platform.
Our problem is very simple, we have about 20 Windows NT4 machines, and as you might know there is no automatic screen turn off option, and its so important to have this option. We tried to code a small Windows application to turn off the monitor using windows APIs, but we were unable to do that...
Can you help us ...
-
Oct 1st, 2001, 04:08 AM
#2
PowerPoster
You can't turn it off par se, but you can put it in power saving mode if it supports it
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, _
ByVal lParam As Any) As Long
Private Const WM_SYSCOMMAND = &H112
Private Const SC_MONITORPOWER = &HF170
Dim l As Long
Private Sub Command1_Click()
'To turn off the monitor:
l = SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 2&)
End Sub
Private Sub Command2_Click()
'Standby monitor:
l = SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 1&)
End Sub
Private Sub Command3_Click()
'To turn on the monitor:
l = SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, -1&)
End Sub
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
|