 |
InitiateShutdown ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
Initiates a shutdown and restart of the specified computer, and restarts any applications that have been registered for restart. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
DWORD WINAPI InitiateShutdown(
__in_opt LPTSTR lpMachineName,
__in_opt LPTSTR lpMessage,
__in DWORD dwGracePeriod,
__in DWORD dwShutdownFlags,
__in DWORD dwReason
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER InitiateShutdown IN Advapi32;
STRING lpMachineName,;
STRING lpMessage,;
LONG dwGracePeriod,;
LONG dwShutdownFlags,;
LONG dwReason
|
 |
 |
 |
| Parameters: |
 |
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. |
 |
 |
| Return value: |
 |
| If the function succeeds, it returns ERROR_SUCCESS (0). |
 |
 |
| Usage: |
 |
#DEFINE SHUTDOWN_RESTART 4
? InitiateShutdown("", "The system is shutting down...",;
10, SHUTDOWN_RESTART, 0)
|
 |
 |
| My comment: |
 |
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 |
 |
 |
| Word Index links for the InitiateShutdown : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2009-02-02 10:49:49 | | Modified: | 2009-02-02 10:53:43 | Visited in last 7 days: 10 |