I'm trying to use the ExitWindowsEX API to shut down windows, and I'm testing it on Windows 2000.

Most of my code is working correctly. If I call the API in "restart" mode then Windows restarts happily. However, if I call the API in "shutdown" mode then windows will shut down to the "It is now safe to switch off" screen.

My PC is an ACPI system, so if I choose Shutdown from the Start menu then it shuts down and powers off.

Can anyone tell me the correct value I should be passing to the API to get the PC to shut down and power off (i.e. behave the same as the start menu)? I guess there are new values for this API with the new Shutdown/Suspend/Hibernate functionality.

I'm calling the API as follows :

Call ExitWindowsEx(EWX_SHUTDOWN, &HFFFF)

where EWX_SHUTDOWN is

Const EWX_SHUTDOWN As Long = 1

Also, I'm going through the "Set Privileges" routines as well.

Anyone any idea?

Thanks in advance,



Jim