Board index » delphi » Shutting Down Windows98 and all programs Running

Shutting Down Windows98 and all programs Running

Hi,
Im am using Delphi4 and want to be able to shut down Windows and all
programs that are running (just as if you do a normal shutdown) on a
ButtonClick event.  Could someone please email me the code to do this.

Thanks in advance....................

--
Anth...@ADcruze.freeserve.co.uk

 

Re:Shutting Down Windows98 and all programs Running


Ant D schrieb in Nachricht <77knae$hv...@news4.svr.pol.co.uk>...

Quote
>Hi,
>Im am using Delphi4 and want to be able to shut down Windows and all
>programs that are running (just as if you do a normal shutdown) on a
>ButtonClick event.  Could someone please email me the code to do this.

>Thanks in advance....................

>--
>Anth...@ADcruze.freeserve.co.uk

You can use the API function

ExitWindows(0,0)

or

ExitWindowsEx(Shutdowntype,0);
where Shutdowntype is one of the following:
EWX_FORCE, EWX_LOGOFF, EWX_POWEROFF, EWX_REBOOT,EWX_SHUTDOWN.

Have a look at it in the Win32 helpfile.

Hth,
Matthias.

Other Threads