[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
GetDialogBaseUnits()-> <nBaseUnits>
--------------------------------------------------------------------------------
RETURNS:
<nBaseUnits> is a long value ( 4 bytes ), with the low-order word of the
return value containing the width in pixels and the high-order word
containing the height of the current dialog box base-width unit
DESCRIPTION:
This function returns the DialogBox base units used by Windows when
creating DialogBoxes. An application should use these values to calculate
the average width of characters in the system font.
The dialog box unit in the x-direction is one-fourth of the width
returned by the GetDialogBaseUnits function, and in the y-direction it
is one-eighth of the height returned by the function.
To use GetDialogBaseUnits to determine the height and width ( in pixels )
of a control, given the width (x) and height (y) in dialog box units, use
the following formulas:
+-------------------------------------------------------------+
| nWidth = ( x * nLoWord( GetDialogBaseUnits() ) ) / 4 |
| nHeight = ( y * nHiWord( GetDialogBaseUnits() ) ) / 8 |
+-------------------------------------------------------------+
To avoid rounding problems, perform the multiplication before the
division, in case the dialog box base units are not evenly divisible by
four.
Fortunatley, FiveWin controls all these processes automatically through
the TDialog Class and DialogBoxes xBase commands.
SOURCE:
SOURCE\WINAPI\DLG2CHR.C
See Also:
nLoWord
nHiWord
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson