|
-
Aug 3rd, 2000, 01:48 PM
#1
Thread Starter
Fanatic Member
Is there any API that could execute the Windows' power saving routines like "Standby", "Suspend", "HD power down" or "Video off"?
-
Aug 5th, 2000, 09:52 AM
#2
This was suppose to be a code to start the screen saver, for some reason, not sure if it's just my computer, it goes to StandBy mode.
Code:
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hWnd As Long, ByVal _
wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function GetDesktopWindow Lib "user32" () As Long
Public Const WM_SYSCOMMAND As Long = &H112&
Public Const SC_SCREENSAVE As Long = &HF140&
Function StandBy() As Boolean
Dim hWnd&
On Error Resume Next
hWnd& = GetDesktopWindow()
Call SendMessage(hWnd&, WM_SYSCOMMAND, SC_SCREENSAVE, 0&)
StandBy = (Err.Number = 0)
End Function
Usage:
Call StandBy
-
Aug 9th, 2000, 12:22 PM
#3
Thread Starter
Fanatic Member
Yes of course my dear Compie!
Why not help myself if nobody else do it?
Public Declare Function SetSystemPowerState Lib "kernel32" (ByVal fSuspend As Long, ByVal fForce As Long) As Long
-> fSuspend has no meaning
-> fForce: 0=prompt, 1=no prompt (immediately)
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
|