quote: I moved WM_DESTROY above the switch(LOWORD(wParam) and was able to make it so that the application would still be running after a menuitem was executed!
Hmm.. this shouldn´t happen, something must be wromg with your switch statement, because the code should work no matter where the WM_DESTROY is:
Try this:
// In WndProc
switch(message)
{
case WM_CREATE:
// Do stuf
return 0;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDM_MY_MENU_ITEM:
// Do stuf
return 0;
case IDM_MY_MENU_ITEM:
MessageBox(hwnd, "MenuItem", "", MB_OK);
return 0;
}
break; // Important
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, message, wParam, lParam);
// End of Wndproc