Okay I created a dialog box in my windows program and everytime I close the dialog it closes my entire program. I checked it and for some reason I am recieving the WM_DESTROY message after I close the dialog!
Here is a bit of the code:
Code:
// processed by the WM_COMMAND in my MainWndProc
case IDM_ADCHAR:
adchar = DialogBox(g_hInst, IDD_ADCHAR, NULL, ADCharDlgProc);
break;
BOOL CALLBACK ADCharDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
return(TRUE);
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDD_ADCHAR_OK:
EndDialog(hwnd, IDD_ADCHAR_OK);
return(TRUE);
case IDD_ADCHAR_CANCEL:
EndDialog(hwnd, IDD_ADCHAR_CANCEL);
return(TRUE);
default:
return(TRUE);
}
return(TRUE);
break;
}
return(FALSE);
}
Thats the only code that deals with the dialog. If you need anymore I can post more, but I'm just wondering why I'm recieving the WM_DESTROY message after closing the dialog box?
Thanks in advance!