Using Win32 functions in Visual FoxPro Image Gallery
System Shutdown
..msdn
ExitWindows
ExitWindowsEx
InitiateShutdown
InitiateSystemShutdown
LockWorkStation
Code examples:
How to initiate System shutdown
InitiateSystemShutdown
..msdn    Add comment     W32 Constants      Translate this page
Initiates a shutdown and optional restart of the specified computer.
Code examples:
How to initiate System shutdown
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:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2001-08-27 12:00:00
Modified: 2009-02-02 10:43:02
Visited in last 7 days: 16
User Contributed Notes:
Jat | 2005-10-10 12:34:58
How can i reset a grid control that show a table using code

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.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.81.79.128)
7 sec.Function: 'socket'
14 sec.Function: 'IsUserAnAdmin'
21 sec.Function: 'keybd_event'
29 sec.Function: 'midiOutClose'
37 sec.Function: 'GetIpStatistics'
45 sec.Function: 'GlobalFree'
53 sec.Function: 'ImageList_GetIconSize'
1.05 min.Function: 'CeFindFirstDatabaseEx'
1.18 min.Function: 'CryptExportKey'
1.33 min.Function: 'TextOut'
Google
Advertise here!