Using Win32 functions in Visual FoxPro Image Gallery
System Shutdown
..msdn
ExitWindows
ExitWindowsEx
InitiateShutdown
InitiateSystemShutdown
LockWorkStation
Code examples:
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:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2009-02-02 10:49:49
Modified: 2009-02-02 10:53:43
Visited in last 7 days: 13
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.91.171.137)
7 sec.Function: 'JetSetColumn'
14 sec.Function: 'SetCurrentDirectory'
21 sec.Function: 'URLDownloadToCacheFile'
29 sec.Function: 'GetThreadDesktop'
36 sec.Function: 'closesocket'
43 sec.Function: 'DragAcceptFiles'
50 sec.Function: 'SwitchToThisWindow'
57 sec.Function: 'GetObjectType'
1.07 min.Function: 'InternetConnect'
1.2 min.Function: 'RegSetValueEx'
Google
Advertise here!