Topic : How to create a window with Win32
Author : Vivek Mohan
Page : << Previous 3  
Go to page :


    {
           MessageBox(NULL , "Failed to create window"
                           , "Error"
                           , MB_ICONEXCLAMATION | MB_OK );
           return 0;
        }

        ShowWindow  (hwnd,nCmdShow);
        UpdateWindow(hwnd);

   // Message looping

   MSG Msg;

   while(GetMessage(&Msg,NULL,0,0))
   {         TranslateMessage(&Msg);
             DispatchMessage (&Msg);
         }
   
   return Msg.wParam;
}

LRESULT CALLBACK WndProc (HWND hwnd , UINT msg,WPARAM wParam , LPARAM lParam)
{       switch(msg)
         {    case WM_CLOSE:
                  DestroyWindow  (hwnd);
                  break;
              case WM_DESTROY:
                  PostQuitMessage(0);
                  break;
              default:
                  return DefWindowProc(hwnd,msg,wParam,lParam);
          }
          return 0;
}



Page : << Previous 3