Found a solution! If I processed the WM_DESTROY message then the application wouldnt end the process. So i just moved the code to WM_CLOSE.
Heres the old that caused the problem:
Code:
case WM_CLOSE:
{ if(::MessageBox(hWnd,"Sure you want to Quit?","Close?", MB_YESNO | MB_ICONEXCLAMATION) == IDYES)
{ ::DestroyWindow(hWnd);
}
return(0);
}
case WM_DESTROY:
{ ::PostQuitMessage(0);
return(0);
}
and the working version:
Code:
case WM_CLOSE:
{ if(::MessageBox(hWnd,"Sure you want to Quit?","Close?", MB_YESNO | MB_ICONEXCLAMATION) == IDYES)
{ ::PostQuitMessage(0);
}
return(0);
}