In the code here:


switch(uiMessage)
{
case WM_PAINT:
//some GDI functions
case WM_DESTROY:
PostQuitMessage(0);
return 0;