请大家帮我想想。。。
我想在按a键时画个矩形,按b键时画个椭圆! (屏幕上只有一个图形,两者不能同时存在)
窗口过程这样写的:
case WM_PAINT: hdc=BeginPaint(hwnd,&ps); EndPaint(hwnd,&ps); return 0;case WM_CHAR: switch(wParam) { case 'a': InvalidateRect(hwnd,NULL,TRUE); UpdateWindow(hwnd); DrawRect(hwnd); break; case 'b': InvalidateRect(hwnd,NULL,TRUE); /*ValidateRect(hwnd,NULL);*/ UpdateWindow(hwnd); DrawRound(hwnd); break; } return 0;