Why does it close here but not there?
Code:
int CALLBACK DlgProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BTN_TEST)
{
iCount = ((GetTickCount() / 1000) / 60);
ltoa(iCount, szTicks, 10);
MessageBox(hWndDlg, szTicks, "Counter", MB_OK);
}
if(LOWORD(wParam) == IDC_BTN_CANCEL)
{
MessageBox(hWndDlg, "Cancel pressed!", "Button", MB_OK);
}
if(LOWORD(wParam) == IDC_BTN_OK)
{
MessageBox(hWndDlg, "OK pressed!", "Button", MB_OK);
return false;
}
case WM_CLOSE:
EndDialog(hWndDlg, 0);
PostQuitMessage(0);
break;
}
return false;
}
If I click the IDC_BTN_TEST button, it tells me a number, like I want it to, then closes. If I click the IDC_BTN_OK button, it tells me "OK pressed!", but it doesn't close. Why is this?