Archived

This topic is now archived and is closed to further replies.

Oranda

How do I tell Windows to shutdown?

Recommended Posts

Oranda    122
Is there an API funtion to make Windows shutdown? It''s for the big "Shutdown" button on my shell replacement. Thanks.

Share this post


Link to post
Share on other sites
Michalson    1657
Take a look on MSDN for ExitWindowsEx. You'll likely want to use the flag EWX_SHUTDOWN (there are also flags for reboot, power off, log off, force application terminate)

[EDIT] Unclosed HREF was screwing up rest of page.

[edited by - michalson on May 2, 2002 8:27:00 AM]

Share this post


Link to post
Share on other sites
sidshaw    122
Yeah, ExitWindowsEx() should do the trick.

The first argument can be either EWX_POWEROFF to shut down and power off or EWX_SHUTDOWN to shutdown to a state where it''s safe to switch the computer off. You can also use this routine to log users off and reboot the machine. Look up the documentation in MSDN...

Share this post


Link to post
Share on other sites
Oranda    122
Thankies! This place sure has grown since I was here last. Half-hour turn-around times for replies is sweet!

Share this post


Link to post
Share on other sites