MapDialogRect

  BOOL MapDialogRect(hwndDlg, lprc)    
  HWND hwndDlg; /* handle of dialog box */
  LPRECT lprc; /* address of structure with rectangle */

This function converts the dialog-box units given in the lprc parameter to screen units. Dialog-box units are stated in terms of the current dialog base unit derived from the average width and height of characters in the system font. One horizontal unit is one-fourth of the dialog base width unit, and one vertical unit is one-eighth of the dialog base height unit. The GetDialogBaseUnits function returns the dialog base units in pixels.

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

Parameters

hwndDlg

Identifies a dialog box.

lprc

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

Return Value

TRUE is returned for success, FALSE for failure.

Comments

The hwndDlg parameter must be created by using the CreateDialog or DialogBox function.

See Also

CreateDialog, DialogBox, GetDialogBaseUnits, ClientToScreen, ScreenToClient, WindowFromPoint, ChildWindowFromPoint