LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { static cxClient,cyClient; int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_SIZE: cxClient=LOWORD(lParam); cyClient=HIWORD(lParam); break; case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hWnd, (DLGPROC)About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... Rectangle(hdc,cxClient/8,cyClient/8,7*cxClient/8,7*cyClient/8); MoveToEx(hdc,0,0,NULL); LineTo(hdc,cxClient,cyClient); MoveToEx(hdc,0,cyClient,NULL); LineTo(hdc,cxClient,0); Ellipse(hdc,cxClient/8,cyClient/8,7*cxClient/8,7*cyClient/8); RoundRect(hdc,cxClient/4,cyClient/4,3*cxClient/4,3*cyClient/4,cxClient/8,cyClient/8); EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }