예)

if (m_hThread) { DWORD dwExitCode = 0; ::GetExitCodeThread(m_hThread, &dwExitCode); if (dwExitCode == STILL_ACTIVE) { AfxMessageBox(_T("실행중인 스레드")); } }


사실 GetExitCodeThread는 스레드 핸들을 인자로 해서 스레드 종료코드를 알아내는 함수이다.
그렇지만 스레드가 종료되기전 GetExitCodeThread를 호출하면 종료코드에 'STILL_ACTIVE'가
담겨져 있다 따라서 스레드가 실행중인지 확인 할 수 있다.

'OS > Windows' 카테고리의 다른 글

CoInitialize(), CoUninitialize() 호출시 주의사항  (0) 2009.02.03
Release에서 디버깅 하기 ...  (0) 2008.11.21
InternetSetOption의 Timeout 설정 버그  (0) 2008.09.16
WM_DESTROY 메세지  (0) 2008.07.21
초보 DLL 사용하기  (0) 2008.02.21
posted by 뚱2