[Win32] Thread 종료 확인 - GetExitCodeThread
저장소/VC++thread의 상태(종료 여부)를 반환한다.
Retrieves the termination status of the specified thread.
BOOL WINAPI GetExitCodeThread(
__in HANDLE hThread,
__out LPDWORD lpExitCode
);
__in HANDLE hThread,
__out LPDWORD lpExitCode
);
Parameters
hThread
A Ahndle to the thread.
The handle must have the THREAD_QUERY_INFORMATION access right. For more information, see Thread Security and Access Rights.
lpExitCode
A pointer to a variable to receive the thread termination status. If the specified thread has not terminated and the function succeeds, the termination status returned is STILL_ACTIVE.
A Ahndle to the thread.
The handle must have the THREAD_QUERY_INFORMATION access right. For more information, see Thread Security and Access Rights.
lpExitCode
A pointer to a variable to receive the thread termination status. If the specified thread has not terminated and the function succeeds, the termination status returned is STILL_ACTIVE.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If the thread has terminated and the function succeeds, 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.
Warning If a thread happens to return STILL_ACTIVE (259) as an error code, applications that test for this value could end up in an infinite loop.
Requirements
Client |
Requires Windows Vista, Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95. |
---|---|
Server |
Requires Windows Server 2008, Windows Server 2003, Windows 2000 Server, or Windows NT Server. |
Header |
Declared in Winbase.h; include Windows.h. |
Library |
Use Kernel32.lib. |
DLL |
Requires Kernel32.dll. |
'저장소 > VC++' 카테고리의 다른 글
SQLite - 쿼리 실행(어떤거 써야해?) (0) | 2009.08.13 |
---|---|
[MFC] MFC에서 Thread를 사용할 때는 _beginthread 말고 AfxBeginThread를 사용해야 한다. (0) | 2009.08.07 |
[Win32] 환경변수 설정 값 가져오기 - GetEnvironmentVariable (0) | 2009.07.31 |
[Error/Warning] error PRJ0002 : xxxxxxxx (0) | 2009.07.27 |
[Win32] 시스템의 Locale 관련 함수들 (0) | 2009.07.07 |