怎样检测线程是否在运行,线程的状态?

解决方案 »

  1.   

    BOOL GetExitCodeThread(
      HANDLE hThread,      // handle to the thread
      LPDWORD lpExitCode   // termination status
    );
    If the specified thread has not terminated, the termination status returned is STILL_ACTIVE. If the thread has terminated, the termination status returned may be one of the following: The exit value specified in the ExitThread or TerminateThread function. 
    The return value from the thread function. 
    The exit value of the thread's process.