HDC hdc = ::GetDC(m_hWnd); RECT rect = { 10,10,50,100 }; RECT rect1; HBRUSH hbr; hbr = CreateSolidBrush(RGB(0, 0, 255)); SelectObject(hdc, hbr); BOOL b= CopyRect(&rect1,&rect); //将一个矩形的坐标拷贝到另一个矩形中 /* 参数1:LPRECT lprc 目标矩形结构 参数2:LPRECT lprc 源矩形 返回值:如果该函数成功,则返回值为非零值。如果函数失败,则返回值为零 */ Sleep(2000); int f = FrameRect(hdc, &rect1, hbr); DeleteObject(hbr); ::ReleaseDC(m_hWnd, hdc);