rt

解决方案 »

  1.   

    BOOL ExitWindowsEx(
      UINT uFlags,       // shutdown operation
      DWORD dwReserved   // reserved
    );
    其中,uFlags为EWX_REBOOT就是重新启动。
      

  2.   

    我试过了,好像不能重起
    Windows 95/98: Because of the design of the shell, calling ExitWindowsEx with EWX_FORCE fails to completely log off the user (the system terminates the applications and displays the Enter Windows Password dialog box, however, the user's desktop remains.) To log off the user forcibly, terminate the Explorer process before calling ExitWindowsEx with EWX_LOGOFF and EWX_FORCE. 
    Windows 95/98: ExitWindowEx does not work from a console application, as it does on Windows NT/Windows 2000. 
    我做的是控制台的程序,会不会不行呢