Reboot or Shutdown a pc
This is a little how-to that explains how to shutdown or reboot a Windows machine in c++ .
In the source code you will find the function ShutDown, definied as follow:
bool ShutDown(bool restart)
The function shutdowns or reboots the pc, and returns false if the shutdown can’t be done (for example a process denied the power off).

So, to shutdown the pc, you only have to call the function and check if the shutdown was done.
if (!ShutDown(false))
{
// shutdown not done.
}
Part of source code following:
Continue Reading »


