 |
InitiateSystemShutdown ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Initiates a shutdown and optional restart of the specified computer. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
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
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE SHORT InitiateSystemShutdown IN advapi32;
STRING lpMachineName,;
STRING lpMessage,;
INTEGER dwTimeout,;
SHORT bForceAppsClosed,;
SHORT bRebootAfterShutdown
|
 |
 |
 |
| Parameters: |
 |
lpMachineName
[in] Pointer to the null-terminated string that specifies the network name of the computer to shut down. If lpMachineName is NULL or an empty string, the function shuts down the local computer.
lpMessage
[in] Pointer to a null-terminated string that specifies a message to display in the shutdown dialog box. This parameter can be NULL if no message is required.
dwTimeout
[in] Specifies the time (in seconds) that the shutdown dialog box should be displayed.
bForceAppsClosed
[in] Specifies whether applications with unsaved changes are to be forcibly closed.
bRebootAfterShutdown
[in] Specifies whether the computer is to restart immediately after shutting down.
|
 |
 |
| Return value: |
 |
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
|
 |
 |
| Usage: |
 |
nResult=InitiateSystemShutdown(cMachineName,;
"System Shutdown initiated...", 10, 0, 1)
|
 |
 |
| My comment: |
 |
Windows NT/2000 or later: Requires Windows NT 3.1 or later.
Windows 95/98/Me: Unsupported.
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.
* * *
The InitiateSystemShutdownEx initiates a shutdown and optional restart of the specified computer, and optionally records the reason for the shutdown. |
 |
 |
| Word Index links for the InitiateSystemShutdown : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2001-08-27 12:00:00 | | Modified: | 2009-02-02 10:43:02 | Visited in last 7 days: 20 |