Link to home
Start Free TrialLog in
Avatar of petershaw9
petershaw9

asked on

How to shut down computer

I am using win 98. In my program, I want to have a shutting down computer function. I try to use ExitWindowsEx(EWX_POWEROFF, 0). But it only does log off in win 98, win me and do nothing in win 2000.
So how can the program shut down a computer?

Thank u


Peter
Avatar of geobul
geobul

Hi,
Use EWX_SHUTDOWN instead. Or (EWX_FORCE or EWX_SHUTDOWN,0) to close all apps immediately.

Regards, Geo
ASKER CERTIFIED SOLUTION
Avatar of TAZI
TAZI
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
'Shutdown PC with all Windows versions' article at http://www.delphi3000.com/article.asp?ID=2108
Avatar of simonet
Here's an article I wrote about this very same issue:


http://www.bhnet.com.br/~simonet/tipstricks/exitwindowsnt.htm

Yours,

Alex