Restart windows

Posted in System

Use ExitWindowEx function. This function allows you to restart Windows as you wish.

procedure TForm1.Button1Click(Sender: TObject);
begin
  ExitWindowsEx(EWX_REBOOT,0);
end;