SetWindowRgn Menu Problem
-
Hi: first i invoke CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5) create a HRGN, then Invoke SetWindowRgn. SetWindowRgn is successful But RoundRect(hdc, rc.left, rc.top, rc.right, rc.bottom, 5, 5) can not Draw round border, I am surprised Because RoundRect Draw the top and left border, but not draw right and bottom border. Please Help me thanks. the code as follow: HRGN hRgn = CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5); ::SetWindowRgn(hwnd, hRgn, TRUE); RoundRect(dcMem, rc.left, rc.top, rc.right, rc.bottom, 5, 5);
-
Hi: first i invoke CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5) create a HRGN, then Invoke SetWindowRgn. SetWindowRgn is successful But RoundRect(hdc, rc.left, rc.top, rc.right, rc.bottom, 5, 5) can not Draw round border, I am surprised Because RoundRect Draw the top and left border, but not draw right and bottom border. Please Help me thanks. the code as follow: HRGN hRgn = CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 5, 5); ::SetWindowRgn(hwnd, hRgn, TRUE); RoundRect(dcMem, rc.left, rc.top, rc.right, rc.bottom, 5, 5);
how you are calculating rc?
-
how you are calculating rc?
-
calculate like this: RECT rc; GetWindowRect(hwnd,&rc); OffsetRect(&rc,-rc.left,-rc.top);