There are at least 2 ways to do this AFAIK.
How to find the position of a Win32 control relative to its parent window?
and this:
How to get the size and location of a control placed in a dialog box in MFC?
htext := GetDlgItem(hDlg, IDI_TEXT); GetWindowRect(htext, R); // (1) // Pt := Point(R.Left, R.Top); // ScreenToClient(hDlg, Pt); // R := Rect(Pt.X, Pt.Y, Pt.X + R.Right - R.Left, Pt.Y + R.Bottom - R.Top); // OR: (2) MapWindowPoints(0, {GetParent(htext)} hDlg, R, 2); FrameRect(dc, R, brush);
Which method is better and why? Is the method with MapWindowPointswork with multiple monitors?
MapWindowPoints
My concern is mainly related to MapWindowPoints, and multi-monitor, since the transfer 0as hWndFromwill be usedHWND_DESKTOP
0
hWndFrom
HWND_DESKTOP
@TLama , . (!:))
(1) ScreenToClien , , WS_EX_LAYOUTRTL, .
(1)
ScreenToClien
WS_EX_LAYOUTRTL
(2) MapWindowPoints .
(2)
, WS_EX_LAYOUTRTL.
.