GetWindowDC 非客户区绘图

来源:互联网 发布:卡通人物设计的软件 编辑:程序博客网 时间:2024/05/22 01:38
   case WM_LBUTTONDOWN:        re.left = 100;        re.right = 200;        re.top =0;        re.bottom = 25;        SendMessageA(hWnd,WM_NCPAINT,(WPARAM)hNcRgn,NULL);        break;    case WM_NCPAINT://注意绘制非客户区,不能直接GetWindowDC在自己窗体上绘制,必须调用WM_NCPAINT,绘制。要绘制就重新绘制        if(wParam ==1)           DefWindowProc(hWnd,message,wParam,lParam);        else        {            HDC hdc;            hdc = GetDCEx(hWnd, (HRGN)wParam, DCX_WINDOW|DCX_INTERSECTRGN);            FillRgn(hdc,(HRGN)wParam,(HBRUSH)GetStockObject(BLACK_BRUSH));          //  sprintf(debugString,"left % d  top is %d  right is %d  bottom is %d \n",(,cyClient);             // OutputDebugStringA(debugString);              // Paint into this DC            ReleaseDC(hWnd, hdc);        }               break;case WM_PAINT: