this should work! dont process WM_CLOSE in WndProc. the only problem is your program wont close unless use a menu item or something.
Code:
LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_COMMAND:
switch(LOWORD(wParam))
{
// menu item
case IDM_EXIT:
DestroyWindow(hwnd);
PostQuitMessage(0);
break;
}
return TRUE;
// try doing this for your default
default:
if(Message != WM_CLOSE)
{
return DefWindowProc(hwnd, Message, wParam, lParam);
}
}
return 0;
}