I seem to be having a simple problem with an application I made. It's just a window with a text box and a couple of straightforward text application things. ~The problem is, any action I preform seems to close the application ~ Save for opening a file, which the program then exits directly after. I thought it was because of a missing break; command, but I couldent find one missing.
Heres the message loop, I'm almost positive the problem is here, but I cant seem to find it;
Code:
<defs>
#define IDR_MENU1 500
#define ID_FILE_EXIT 900
#define ID_FILE_NEW 901
#define ID_FILE_OPEN 902
#define ID_FILE_SAVE 903
#define ID_FILE_SAVE_AS 904
#define ID_FUNCTION_NEW 100
#define ID_SURFACE_EDIT 200
<defs>
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
switch(msg) {
case WM_CREATE:
TextBoxSetup(hwnd);
break;
case WM_SIZE: { //WM SIZE START---
HWND hEdit;
RECT rcClient;
GetClientRect(hwnd, &rcClient);
hEdit = GetDlgItem(hwnd, ID_SURFACE_EDIT);
SetWindowPos(hEdit, NULL, 0, 0, rcClient.right, rcClient.bottom, SWP_NOZORDER);
}
break; //END OF WM SIZE---
case WM_COMMAND: //COMMAND PARSE START---
switch(LOWORD(wParam)){
case ID_FILE_EXIT:
PostMessage(hwnd, WM_CLOSE, 0, 0);
break;
case ID_FILE_NEW:
break;
case ID_FILE_OPEN:
OpenFileName(hwnd);
break;
case ID_FILE_SAVE:
break;
case ID_FILE_SAVE_AS:
break;
default:
break;
} //COMMAND PARSE END---
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
I've been poking around the code for awhile and I just dont see any issues -,-.