Board index » delphi » "Shutdown/Restart" in Windows95/98

"Shutdown/Restart" in Windows95/98

Is possible to execute a shutdown or a restart in a delphi program ?
How can i call this functions ? I just want it done a single step, no
confirmation or dialog box. - I'll using this to shutdown my ATX
power system in a specific time. Please post any tips or ideas or just
email me.

Thanks in advance, R.M.

Rui Monteiro
l41...@alfa.ist.utl.pt

 

Re:"Shutdown/Restart" in Windows95/98


Rui,

You can use the Windows API call to ExitWindowsEx. You should only use the
first parameter (since the second is reserved) using a combination of the
flags shown in the Window API help. For example:

procedure TForm1.Button1Click( Sender: TObject ) ;
begin
  ExitWindowsEx( EWX_LOGOFF , 0 ) ;
  Close ;
end ;

would tell windows to log off the current user and then the app would exit.

James

Quote
Rui Monteiro wrote in message <358ecb21.12575...@www.ist.utl.pt>...
>Is possible to execute a shutdown or a restart in a delphi program ?
>How can i call this functions ? I just want it done a single step, no
>confirmation or dialog box. - I'll using this to shutdown my ATX
>power system in a specific time. Please post any tips or ideas or just
>email me.

>Thanks in advance, R.M.

>Rui Monteiro
>l41...@alfa.ist.utl.pt

Re:"Shutdown/Restart" in Windows95/98


Use the WIN32 API function:

ExitWindowsEx(EWX_SHUTDOWN);

See Win32.hlp for more information;

Regards
  Frans.

Quote
> ----------
> Van:       l41...@alfa.ist.utl.pt (Rui
> Monteiro)[SMTP:l41...@alfa.ist.utl.pt]
> Gepost op:         maandag 22 juni 1998 23:32
> Gepost naar:       borland-delphi
> Discussie:         "Shutdown/Restart" in Windows95/98
> Onderwerp:         "Shutdown/Restart" in Windows95/98

> Is possible to execute a shutdown or a restart in a delphi program ?
> How can i call this functions ? I just want it done a single step, no
> confirmation or dialog box. - I'll using this to shutdown my ATX
> power system in a specific time. Please post any tips or ideas or just
> email me.

> Thanks in advance, R.M.

> Rui Monteiro
> l41...@alfa.ist.utl.pt

Other Threads