I’ve got the pointer to the control with function
CWnd* CWnd::GetDlgItem(int ITEM_ID)
so i’ve got CWnd* pointer which points to the control,
but simply can’t find any method within CWnd class that will
retrieve the size and location of a given control.
Any help?
GetWindowRectgives the screen coordinates of the control.pDlg->ScreenToClientwill then convert them be relative to the dialog’s client area, which is usually what you need.Note:
pDlgabove is the dialog. If you’re in a member function of the dialog class, just remove thepDlg->.