Power control of windows: How to reboot and wake from hibernate/standby?

Hi everyone:

I have only found

system.windows.forms.application.setsuspendstate

method could make system into standby or hibernate state, but I don't
know how to reboot the system via .net method.
Must I call API functions to reboot the system

And I want to know how to wake up the system after hibernate/standby
For example, if my user input "3" and hibernate, the system should
enter hibernate and wake up itself after 3 minutes.

Is that a method could do this in .net framework
or which API should I call

Thanks very much!!!



Answer this question

Power control of windows: How to reboot and wake from hibernate/standby?

  • BennyWang

    It should be convertable fairly easily - its a call the Windows API's only.

    The thing to remember is that Long in VB6 is Integer in VB.Net. Using Long in VB.net declarations will result in a exception when trying to use it.

    Might I suggest to find the declaration statements for many of the windows API's

    http://www.pinvoke.net/


  • MSenthilVel

    Thanks!

    I'm not familiar with VB6, but I'll try to traslate it , If I got the last solution,

    I'll paste the code here.



  • daveimme

    I was searching for the same o were I i find a answer, see this link:
    http://www.vbforums.com/showthread.php t=396217

    The code you will thing is writing in VB6 but you can try to convert to VB.NET. If you can convert please let me know. Thanks.

  • Curtis Barton

    then could you tell me or anyone else knows which BIOS function it call
    -_-##


    Thanks so much!!


  • chris steele

    Um, I don't think there are any program running in hibernate (or suspend) state: it would probably be a BIOS function to do something like that (e.g. WOL - Wake-On-Lan). So, a program would not be able to wake itself up.



  • Power control of windows: How to reboot and wake from hibernate/standby?