>So The command should be the following ?
>
>=ExitWindowsEx(EWX_POWEROFF + EWX_FORCE, 0)
>---OR---
>=ExitWindowsEx(12, 0)
>
>It Does'nt work for me, It only logs off my morkstation.
(1) Is APM enabled? If not, it won't work. EWX_SHUTDOWN + EWX_FORCE (5) will consistently force a shutdown, regardless of APM settings, under Win98.
(2) I've seen this not work in NT systems because of process privileges; it works reliably from Win98 (I've already tried it here on a Win98 system with APM to make sure.) The logoff is the behavior most often seen from an NT system. It may be that other software, possibly an AV app, is intercepting this, but again, without knowing what your system configuration is, I can't be sure.
>
>Any idea ?
>
>>
>>You need both the EWX_FORCE and EWX_SHUTDOWN values (EWX_SHUTDOWN + EWX_FORCE), and you must have ACPI/APM enabled on the station if you want it to actually power off the system and then use EWX_POWEROFF + EWX_FORCE.)