The dialog box header contains general dialog box data, such as the dialog box window style, the number of controls in the dialog box, the coordinates of the upper-left corner of the box, the width and height of the box, the name of the menu to be displayed, and so on. The DialogBoxHeader structure has the following form:
struct DialogBoxHeader {
DWORD lStyle;
BYTE bNumberOfItems;
WORD x;
WORD y;
WORD cx;
WORD cy;
char szMenuName[];
char szClassName[];
char szCaption[];
WORD wPointSize; /* only if DS_SETFONT */
char szFaceName[]; /* only if DS_SETFONT */
};
Following are the members in the DialogBoxHeader structure:
lStyle
Specifies the dialog-window style. This member is a combination of the window-style and dialog-style flags that are found in the WINDOWS.H include file.
bNumberOfItems
Specifies the number of controls in the dialog box.
x
Specifies the x-coordinate of the upper-left corner of the dialog box. This coordinate is a horizontal distance from the left edge of the parent window. This distance is specified by using a special horizontal dialog box unit equivalent to the average character width of the font divided by 4. If the DS_SETFONT flag is set, the average character width of the font specified in the dialog box header is used. Otherwise, the average character width of the system font is used.
y
Specifies the y-coordinate of the lower-left corner of the dialog box. This coordinate is a vertical distance from the top of the parent window. This distance is specified by using a special vertical dialog box unit equivalent to the character height of the current font divided by 8. If the DS_SETFONT flag is set, the height of the font specified in the dialog box header is used. Otherwise, the height of the system font is used.
cx
Specifies the width of the dialog box, in horizontal dialog units. (See the description of the x member for a definition of horizontal dialog units.)
cy
Specifies the height of the dialog box, in vertical dialog units. (See the description of the y member for a definition of vertical dialog units.)
szMenuName
Identifies a menu resource associated with the dialog box. If no menu is associated with the dialog box, this array contains a single-byte value of zero. If the menu has an ordinal identifier, the first byte of this member contains 0xFF and the subsequent two bytes contain the ordinal value. If the menu has a name identifier, the member contains a null-terminated string that specifies the menu name.
szClassName
Specifies the class name for the dialog box. If the dialog box uses the default class, this member contains a single-byte value of zero. Otherwise, this member contains a null-terminated string that specifies the name of the dialog class.
szCaption
Specifies a dialog box caption. This array must contain a null-terminated string.
wPointSize
Specifies the point size of a font that is unique to the dialog box. (This member is present only if the DS_SETFONT flag is set by the lStyle member.)
szFaceName
Specifies the typeface name of a dialog box font. This array must contain a null-terminated string. (This member is present only if the DS_SETFONT flag is set by the lStyle member.)