The parameter passed to InitiateSystemShutdown functions are BOOL WINAPI InitiateSystemShutdown( __in_opt LPTSTR lpMachineName, __in_opt LPTSTR lpMessage, __in DWORD dwTimeout, __in BOOL bForceAppsClosed, __in BOOL bRebootAfterShutdown ); Parameters lpMachineName [in, optional] The network name of the computer to be shut down. If lpMachineName is NULL or an empty string, the function shuts down the local computer. lpMessage [in, optional] The message to be displayed in the shutdown dialog box. This parameter can be NULL if no message is required. dwTimeout [in] The length of time that the shutdown dialog box should be displayed, in seconds. While this dialog box is displayed, the shutdown can be stopped by the AbortSystemShutdown function. If dwTimeout is not zero, InitiateSystemShutdown displays a dialog box on the specified computer. The dialog box displays the name of the user who called the function, displays the message specified by the lpMessage parameter, and prompts the user to log off. The dialog box beeps when it is created and remains on top of other windows in the system. The dialog box can be moved but not closed. A timer counts down the remaining time before a forced shutdown. If dwTimeout is zero, the computer shuts down without displaying the dialog box, and the shutdown cannot be stopped by AbortSystemShutdown. bForceAppsClosed [in] If this parameter is TRUE, applications with unsaved changes are to be forcibly closed. Note that this can result in data loss. If this parameter is FALSE, the system displays a dialog box instructing the user to close the applications. bRebootAfterShutdown [in] If this parameter is TRUE, the computer is to restart immediately after shutting down. If this parameter is FALSE, the system flushes all caches to disk and safely powers down the system. Return Value If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
From novice to tech pro — start learning today.