System Restart
-
Can we restart the system programatically? Can you show me tha way? Thank you.
Saadhinchaali
-
Can we restart the system programatically? Can you show me tha way? Thank you.
Saadhinchaali
The following is from MSDN : BOOL WINAPI InitiateSystemShutdown( __in_opt LPTSTR lpMachineName, __in_opt LPTSTR lpMessage, __in DWORD dwTimeout, __in BOOL bForceAppsClosed, __in BOOL bRebootAfterShutdown ); Initiates a shutdown and optional restart of the specified computer. To record a reason for the shutdown in the event log, call the InitiateSystemShutdownEx function. However, note the following : To shut down the local computer, the calling thread must have the SE_SHUTDOWN_NAME privilege. To tweak privileges, use OpenProcessToken(), LookupPrivilegeValue(), AdjustTokenPrivileges(). Best of luck, Bio.
-
Can we restart the system programatically? Can you show me tha way? Thank you.
Saadhinchaali
See
ExitWindowsEx
. -
See
ExitWindowsEx
.Thank you so much guys.
Saadhinchaali
-
Thank you so much guys.
Saadhinchaali
You're welcome. ;)