일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 게임 외주
- 프로그램 개발
- 프로그램 외주
- 포커게임
- 홀뎀
- 옥션해킹
- 상호링크
- 영어단어게임
- 카일레라
- 윈윈
- MAME
- 보드게임
- 판매
- 서치아이
- 온라인게임
- 카일레라서버
- 게임 개발
- 맞고
- 포커
- 고스톱
- Mame32
- 틀린그림 찾기
- 윈윈전략
- 써치아이
- 옥션소송
- 영어단어
- 틀린그림찾기
- holdem
- 맞고게임
- 티스토리 초대장
- Today
- Total
kyuseo의 게임 프로그래밍
CWinThread::PreTranslateMessage 함수의 리턴값(return)의 의미 본문
개요.. |
CWinThread::PreTranslateMessage 함수는 윈도우(CWnd)의 자식을 비롯하여 다양한 윈도우 메시지를 가로채서 처리하는 역할을 합니다.
PreTranslateMessage 함수를 재정의하여 메시지(Message, MSG) 를 처리한 이후에 리턴값을 어떻게 하는지 설명합니다.
설명 |
PreTranslateMessage함수를 재정의 하여,
- 더 이상 메시지가 처리되지 않기를 바란다면 1(0이 아닌값)을 리턴 합니다.
- 만일 메시지가 계속 처리하기를 원한다면 0을 리턴 합니다.
참고로 MFC CWnd 의 다음과 같은 코드를 보면 PreTranslateMessage 함수의 리턴값이 0 이 아니라면 더 이상 메시지를 Walk 하지 않습니다.
BOOL PASCAL CWnd::WalkPreTranslateTree(HWND hWndStop, MSG* pMsg) { ASSERT(hWndStop == NULL || ::IsWindow(hWndStop)); ASSERT(pMsg != NULL);
// walk from the target window up to the hWndStop window checking // if any window wants to translate this message
for (HWND hWnd = pMsg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd)) { CWnd* pWnd = CWnd::FromHandlePermanent(hWnd); if (pWnd != NULL) { // target window is a C++ window if (pWnd->PreTranslateMessage(pMsg)) return TRUE; // trapped by target window (eg: accelerators) }
// got to hWndStop window without interest if (hWnd == hWndStop) break; } return FALSE; // no special processing } |
함수 원형 및 MFC 설명 |
virtual BOOL PreTranslateMessage(
MSG *pMsg
);
Return Value
Nonzero if the message was fully processed in PreTranslateMessage and should not be processed further. Zero if the message should be processed in the normal way.