Leonid F.
Leonid F.

Reputation: 597

Tell Windows XP to Standby programmatically

How can I tell Windows XP to switch to standby mode programmatically with C/C++ native code?

Upvotes: 1

Views: 1167

Answers (2)

mattbasta
mattbasta

Reputation: 13709

A likely function in the Win32 API is SetSuspendState:

SetSuspendState(TRUE, FALSE, FALSE);

From: http://msdn.microsoft.com/en-us/library/aa373201(VS.85).aspx

Upvotes: 4

loentar
loentar

Reputation: 5239

Try this:

SetSystemPowerState(TRUE, TRUE);

http://msdn.microsoft.com/en-us/library/aa373206.aspx

Upvotes: 1

Related Questions