C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[50369] Re:쓰레드가 종료되었는지 알수 있을가요?
아루스 [tinydew4] 2392 읽음    2007-08-24 15:48
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
   );   

Parameters
hProcess - Identifies the process.
lpExitCode - Points to a 32-bit variable to receive the process termination status.

Return Values
성공하면 non-zero 실패하면 zero

Example
DWORD Result;
if ( Thread1 != NULL && GetExitCodeThread( Thread1->Handle, Result ) != 0 && Result == STILL_ACTIVE )
{
    ShowMessage( "살아있다!" );
}


c++초보 님이 쓰신 글 :
: static unsigned __stdcall aaa(LPVOID lParam)
: {
:     bbb * p = (bbb*)lParam;
:
:     while(p->flag_p)
:     {
:         p->aProcess();
:         Sleep(1);
:     }
:
:     _endthreadex(0);
:
:     return 0;
: }
:
: pclose()
: {
:     flag_p = flase;
: }
:
: _beginthreadex로 aaa쓰레드를 생성 한 후
: pclose()함수를 실행시켜 쓰레드의 조건을 변경하여 쓰레드를 종료시켰습니다.
: 여기서 궁금한 점은 _endthreadex(0)가 실행되어 쓰레드가 종료된걸 확인할수 있을가요?

+ -

관련 글 리스트
50366 쓰레드가 종료되었는지 알수 있을가요? c++초보 1795 2007/08/24
50369     Re:쓰레드가 종료되었는지 알수 있을가요? 아루스 2392 2007/08/24
50390         답변 감사드립니다. c++초보 1415 2007/08/27
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.