Export (0) Print
Expand All


Call to convert the dialog-box units of a rectangle to screen units.

void MapDialogRect(
   LPRECT lpRect 
) const;



Points to a RECT structure or CRect object that contains the dialog-box coordinates to be converted.

Dialog-box units are stated in terms of the current dialog-box base unit derived from the average width and height of characters in the font used for dialog-box text. One horizontal unit is one-fourth of the dialog-box base-width unit, and one vertical unit is one-eighth of the dialog-box base height unit.

The GetDialogBaseUnits Windows function returns size information for the system font, but you can specify a different font for each dialog box if you use the DS_SETFONT style in the resource-definition file. The MapDialogRect Windows function uses the appropriate font for this dialog box.

The MapDialogRect member function replaces the dialog-box units in lpRect with screen units (pixels) so that the rectangle can be used to create a dialog box or position a control within a box.

Community Additions

© 2015 Microsoft