VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Hibernate/Suspend

by kwyap (1 Submission)
Category: Complete Applications
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

A simple program showing how to hibernate or suspend Windows if the hardware is enabled and is supported.

Assumes
Works for Windows ME, XP, 2000, and 2003. Feel free to use these codes in your projects :) Btw, it might not work if the current user do not have the privilage to execute the requested task.
API Declarations
' Determines whether the computer supports hibernation
Private Declare Function IsPwrHibernateAllowed Lib "powrprof.dll" () As Long
' Determines whether the computer supports the sleep states
Private Declare Function IsPwrSuspendAllowed Lib "powrprof.dll" () As Long
' Determines whether the computer supports the soft off power state
Private Declare Function IsPwrShutdownAllowed Lib "powrprof.dll" () As Long
' Suspends the system by shutting power down
' Hibernate - If this parameter is TRUE, the system hibernates. If the parameter is FALSE, the system is suspended
Private Declare Function SetSuspendState Lib "powrprof.dll" (ByVal Hibernate As Long, ByVal ForceCritical As Long, ByVal DisableWakeEvent As Long) As Long

Rate Hibernate/Suspend

Download Hibernate/Suspend

Download Hibernate/Suspend (2 KB)

Hibernate/Suspend Comments

No comments have been posted about Hibernate/Suspend. Why not be the first to post a comment about Hibernate/Suspend.

Post your comment

Subject:
Message:
0/1000 characters