怎样获取 CDialog 窗口 DC 剪切域?
当 CDialog 有一部分被其它窗口档住, 如何可以获取到准确的剪切域(HRGN, CRgn).
附: GetBoundsRect() 和 GetClipBox 得到的是一个近似距形.
我尝试用 GetClipRgn(hmydc, rgn); 每次返回都是 0 . 代码如下.
CRgn rgn;
rgn.CreateRectRgn(0, 0, 100, 100);
int n;
HDC hmydc = ::GetDC(m_hWnd);
n = ::GetClipRgn(hmydc, rgn);
::ReleaseDC(m_hWnd, hmydc);
If the function succeeds and there is no clipping region for the given device context, the return value is zero. If the function succeeds and there is a clipping region for the given device context, the return value is 1.