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:
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?
// processed by the WM_COMMAND in my MainWndProc
adchar = DialogBox(g_hInst, IDD_ADCHAR, NULL, ADCharDlgProc);
BOOL CALLBACK ADCharDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Thanks in advance!
This is my best guess: It might be sending the WM_DESTROY message for the dialog Handle and not the main window. You need to check which handle is being destroyed.
My problem is that I KNOW that my main window is being destroyed. I see it happen. I click "okay" or "cancel" on my dialog and it closes my entire program. I did a check and I made it so then if my main window gets a WM_DESTROY message it will inform me via a message box. And I get that message box everytime I close the dialog.
Any other suggestions?
can you zip up the source and attach to the thread?! you haven't given enough info.
Well I have figured out the problem on my own, thanks anyways.