If you are programing to get any windows xp or above machine to power off or standby there is already a tool included with the oeprating system that you can call. its called shutdown.exe and it does just that run it with the argument -i and it displays its gui (shutdown -i) try it and see if it fits your needs.
Last Wiki Answer Submitted: July 11, 2008 5:21 pm by Flame14,895 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
You can also use this to enter stand-by or, if you have enabled hibernation, to make your computer hibernate with a single mouse click:
%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
Didn’t know about this one…
Thanks!