를 종료하지 않습니다내 Win32 응용 프로그램이 내 메인 루프입니다 메인 루프를
while(TRUE)
{
PeekMessage(&msg,hWnd,0,0,PM_REMOVE);
if (msg.message==WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
이 내 콜백 프로 시저입니다 : 내가 닫기 버튼 WM_NCLBUTTONDOWN 누르면 것을 발견
LRESULT CALLBACK WinProc(HWND hWnd,UINT msg1,WPARAM wParam,LPARAM lParam)
{
switch(msg1)
{
case WM_DESTROY :
{
PostQuitMessage(0);
return 0;
}
break;
}
return DefWindowProc(hWnd,msg1,wParam,lParam);
}
다음 루프에서 PeekMessage 함수에 의해 반환되며 WM_QUIT는 반환되지 않습니다.
주 전에이 같은 문제에 대한 또 다른 질문이 있었다 : [무한 윈도우 메시지 루프 (http://stackoverflow.com/questions/10658813/infinite -windows-message-loop) – jamesdlin