Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I make windows Hibernate from VB? 1

Status
Not open for further replies.

lbaker78

Technical User
Jul 20, 2005
17
GB
Hi All,

I am writing a very simple app that will shut my laptop down when the power is unplugged. I am using the Sysinfo Active X control v6 to monitor the status every 10 secs via a timer, but I want the laptop to enter Hibernate instead of shutdown (shell"shutdown -s") but can't seem to find a way to call the hibernate procedure... Any ideas?

TIA! :)
 
Try this.

[tt]Shell "rundll32 powrprof,SetSuspendState"[/tt]
 
Genius! Works a treat, thanks Hypetia. :)
 
lbaker78, did you know that you could use the Private Sub Sysinfo_PowerStatusChanged() instead of using a timer?

Maybe this world is another planet’s Hell.
Aldous Huxley

 
BigTimmin, I hadnt thought of that! hehe that makes my simple app even more simple! :) Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top