I really enjoy one of the windows computer hibernate benefits:
I can power up the computer by pressing any key or mouse button.
I wish I can shutdown my computer into hibernate state. I mean, software OS is completely off, but hardware goes to hibernate level (I think it is S4). So I don't need to bend over to press the "hard-to-reach" power button on the PC case every time I want to turn on the computer.
Is there anyway programmly I can do that?
Already tried:
DllCall("ntdll.dll", "dword", "NtSetSystemPowerState", "dword", X, "dword", X, "ulong", 0x80000000)
Multiple power state values tested using the correct privilege, they either shutdown my pc or do-nothing. I can't programmly put my pc into S3 or S4 power state.
#include <stdlib.h>
int main()
{
system("SHUTDOWN /H");
}
SetSuspendState is the API to put the system into hibernate and well documented on MSDN.
User contributions licensed under CC BY-SA 3.0