Help dear ones.

Such a task: it is necessary to programmatically turn off the PC, but not so long ago I sat down for C ++ in C builder, I know how to turn it off, but at Visual Studio 2008 I cannot.

Thank.

  • If you turn off components in the builder without help, then transfer it to Visual Studio in most cases - ctrl + c = crtlv + v. - KoVadim
  • Here is ExitWindowsEx (EWX_SHUTDOWN, NULL); In the builder he robs, but he does not want to VS, this is how I understand the function of the builder himself. - Rimon
  • it's easier :) system ("shut down -s -t 10"); - Crasher
  • For the system function you need to connect something? but it does not work - Rimon

1 answer 1

On Visual C ++, shutdown will be performed using the same Windows API function as Builder C ++, namely: ExitWindowsEx .