Group: System Shutdown - Library: advapi32
Initiates a shutdown and restart of the specified computer, and restarts any applications that have been registered for restart.
DWORD WINAPI InitiateShutdown(
__in_opt LPTSTR lpMachineName,
__in_opt LPTSTR lpMessage,
__in DWORD dwGracePeriod,
__in DWORD dwShutdownFlags,
__in DWORD dwReason
); DECLARE INTEGER InitiateShutdown IN Advapi32;
STRING lpMachineName,;
STRING lpMessage,;
LONG dwGracePeriod,;
LONG dwShutdownFlags,;
LONG dwReason lpMachineName [in, optional] The name of the computer to be shut down. If the value of this parameter is NULL, the local computer is shut down.
lpMessage [in, optional] The message to be displayed in the interactive shutdown dialog box.
dwGracePeriod [in] The number of seconds to wait before shutting down the computer.
dwShutdownFlags [in] One or more bit flags that specify options for the shutdown.
dwReason [in] The reason for initiating the shutdown. This parameter must be one of the system shutdown reason codes.
If the function succeeds, it returns ERROR_SUCCESS (0).
To shut down the local computer, the calling thread must have the SE_SHUTDOWN_NAME privilege.
To shut down a remote computer, the calling thread must have the SE_REMOTE_SHUTDOWN_NAME privilege on the remote computer.
Minimum supported client: Windows Vista
See also: InitiateSystemShutdown.
Home