Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 May : Shut down and Restart and the Windows API

www.cryer.info
Managed Newsgroup Archive

Shut down and Restart and the Windows API

Subject:Shut down and Restart and the Windows API
Posted by:"Norman McFarlane" (normanatredpointdotcodotza)
Date:Tue, 24 May 2005 10:10:18

Hi group,

Not too sure whether I am in the right group. If not, please point me in the
right direction.

I need to shutdown and restart the PC in a Delphi 7 app. I have written. I
have tried using two Windows API calls, neither of which seem to work:

      ExitWindowsEx(EWX_FORCE+EWX_LOGOFF+EWX_REBOOT,0);
      InitiateSystemShutdown(PChar(''),PChar(''),0,True,True)

Neither have any effect. My development PC is running Windows Xp
Professoinal.

What am I missing?

Regards,
Morpheus

Replies:

www.cryer.info
Managed Newsgroup Archive