RECT Structure The RECT data structure has the following form:typedef struct tagRECT { LONG left; LONG top; LONG right; LONG bottom; } RECT;The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.MembersleftSpecifies the x-coordinate of the upper-left corner of a rectangle.topSpecifies the y-coordinate of the upper-left corner of a rectangle.rightSpecifies the x-coordinate of the lower-right corner of a rectangle.bottomSpecifies the y-coordinate of the lower-right corner of a rectangle.See Also CRectCRect The CRect class is similar to a Windows RECT structure. CRect also includes member functions to manipulate CRect objects and Windows RECT structures. A CRect object can be passed as a function parameter wherever a RECT structure, LPCRECT, or LPRECT can be passed.Note This class is derived from the tagRECT structure. (The name tagRECT is a less-commonly-used name for the RECT structure.) This means that the data members (left, top, right, and bottom) of the RECT structure are accessible data members of CRect.A CRect contains member variables that define the top-left and bottom-right points of a rectangle. CRect rcButton;rcButton.top = 0; rcButton.left = 0 ; rcButton.right = 100; rcButton.buttom = 100
The RECT data structure has the following form:typedef struct tagRECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT;The RECT structure defines the coordinates of the upper-left and lower-right corners of a rectangle.MembersleftSpecifies the x-coordinate of the upper-left corner of a rectangle.topSpecifies the y-coordinate of the upper-left corner of a rectangle.rightSpecifies the x-coordinate of the lower-right corner of a rectangle.bottomSpecifies the y-coordinate of the lower-right corner of a rectangle.See Also CRectCRect
The CRect class is similar to a Windows RECT structure. CRect also includes member functions to manipulate CRect objects and Windows RECT structures. A CRect object can be passed as a function parameter wherever a RECT structure, LPCRECT, or LPRECT can be passed.Note This class is derived from the tagRECT structure. (The name tagRECT is a less-commonly-used name for the RECT structure.) This means that the data members (left, top, right, and bottom) of the RECT structure are accessible data members of CRect.A CRect contains member variables that define the top-left and bottom-right points of a rectangle.
CRect rcButton;rcButton.top = 0;
rcButton.left = 0 ;
rcButton.right = 100;
rcButton.buttom = 100
CRect rect;
CWnd* pWnd=GetDlgItem(IDC_BUTTON1);
pWnd->GetWindowRect(&rect);
ScreenToClient(&rect);
m_button.Create("Text",WS_VISIBLE|WS_CHILD|BS_AUTORADIOBUTTON,rect,OnOK,IDOK);