可不可以设置ExitCode
怎样写,怎样调用。(只是想把ExitCode返回给后台程序)

解决方案 »

  1.   

    比如说
    进程的 VOID ExitProcess(
      UINT uExitCode   // exit code for all threads
    );GetExitCodeProcess
    The GetExitCodeProcess function retrieves the termination status of the specified process. BOOL GetExitCodeProcess(
      HANDLE hProcess,     // handle to the process
      LPDWORD lpExitCode   // address to receive termination status
    );线程的 GetExitCodeThread
    The GetExitCodeThread function retrieves the termination status of the specified thread. BOOL GetExitCodeThread(
      HANDLE hThread,      // handle to the thread
      LPDWORD lpExitCode   // address to receive termination status
    );比如C++的 main
    int main()
    {
      return 0; // 就是ExitCode.
    }应该可以通过上面的函数获取。