Using Win32 functions in Visual FoxPro Image Gallery
System Shutdown
Code examples:
How to initiate System shutdown
..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
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
[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.

[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.

[in] Specifies the time (in seconds) that the shutdown dialog box should be displayed.

[in] Specifies whether applications with unsaved changes are to be forcibly closed.

[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.
    "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 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: 26
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-2018 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.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (
17 sec.Function: 'mmioAscend'
37 sec.Function: 'MultiByteToWideChar'
58 sec.Function: 'QueryPerformanceFrequency'
1.32 min.Function: 'InternetAutodialHangup'
1.68 min.Function: 'LsaLookupSids'
2.05 min.Function: 'OpenDesktop'
2.42 min.Function: 'WritePrivateProfileString'
2.77 min.Function: 'GdipFillPieI'
3.1 min.Function: 'CM_Request_Device_Eject_Ex'
3.42 min.Function: 'ToAscii'
Advertise here!