See also the Win32 SDK Function:
InitiateSystemShutdown
The InitiateSystemShutdown function initiates a shutdown and optional restart of the specified computer.
To record a reason for the shutdown in the event log, call the InitiateSystemShutdownEx function.
BOOL InitiateSystemShutdown(
LPTSTR lpMachineName, // computer name
LPTSTR lpMessage, // message to display
DWORD dwTimeout, // length of time to display
BOOL bForceAppsClosed, // force closed option
BOOL bRebootAfterShutdown // reboot option
);
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Unsupported.
Windows CE: Unsupported.
Header: Declared in winreg.h; include windows.h.
Library: Use advap
i32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd