Results 1 to 3 of 3

Thread: Windows 9x Standby/suspend/video down

  1. #1

    Thread Starter
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553

    Exclamation

    Is there any API that could execute the Windows' power saving routines like "Standby", "Suspend", "HD power down" or "Video off"?

  2. #2
    Guest
    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

  3. #3

    Thread Starter
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553

    Talking

    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
  •  



Click Here to Expand Forum to Full Width