typedef struct { /* dltt */
DWORD style;
DWORD dwExtendedStyle;
WORD cdit;
WORD x;
WORD y;
WORD cx;
WORD cy;
} DLGTEMPLATE;
The DLGTEMPLATE defines the contents of a dialog box. This structure is divided into three distinct parts:
Part | Description |
Header Data Structure | Contains a general description of the dialog box. |
Font-Information Data Structure | Defines the font with which text is drawn in the dialog box. This part is optional. |
List of Items | Describes the parts that compose the dialog box. |
The CreateDialogIndirect, CreateDialogIndirectParam, DialogBoxIndirect, and DialogBoxIndirectParam functions use this structure.
dtStyle
Specifies the style of the dialog box. This field may be any or all of these values:
Value | Meaning |
DS_LOCALEDIT | Specifies that text storage for edit controls will be allocated in the application's local data segment. This allows the use of the EM_GETHANDLE and EM_SETHANDLE messages. If this style is not specified, edit-control data is located in a separate global data block. |
DS_SYSMODAL | Specifies a system-modal dialog box. |
DS_MODALFRAME | Specifies a dialog box with a modal dialog-box border. This style can be combined with the WS_CAPTION and WS_SYSMENU style flags to create a dialog box with a title bar and System menu. |
DS_ABSALIGN | Indicates that dtX and dtY are relative to the screen origin, not to the owner of the dialog box. |
DS_SETFONT | Specifies that a font other than the system font is to be used to draw text in the dialog box. If this flag is set, the FONTINFO data structure described in the following paragraphs must immediately follow the DLGTEMPLATE header. |
When Windows creates a dialog box with this attribute, Windows sends the WM_SETFONT message to the dialog-box window prior to creating the controls. |
dtItemCount
Specifies the number of items in the dialog box. A dialog box can contain up to 255 controls.
dtX
Specifies the x-coordinate of the upper-left corner of the dialog box in units of 1/4 of the current dialog base width unit. The dialog base units are computed from the height and width of the current system font; the GetDialogBaseUnits function returns the current dialog base units in pixels. Unless DS_ABSALIGN is set in the dtStyle member, this value is relative to the origin of the parent window's client area.
dtY
Specifies the y-coordinate of the upper-left corner of the dialog box in units of 1/8 of the current dialog base height unit. Unless DS_ABSALIGN is set in the dtStyle member, this value is relative to the origin of the parent window's client area.
dtCX
Specifies the width of the dialog box in units of 1/4 of the dialog base width unit.
dtCY
Specifies the height of the dialog box in units of 1/8 of the dialog base height unit.
dtMenuName[]
Specifies a null-terminated string that specifies the name of the dialog box's menu. If this member is NULL, the dialog-box window does not have a menu.
dtClassName[]
Specifies a null-terminated string that supplies the name of the dialog box's class. If dtClassName[] is zero, it creates a dialog box with the standard dialog-box style. If an application specifies a class name, it should provide a dialog procedure that processes each dialog-box message directly or calls the DefDlgProc function to process the message. Also, the application must register the class with the cbWndExtra member of the WNDCLASS data structure set to DLGWINDOWEXTRA.
dtCaptionText[]
Specifies a null-terminated string that supplies the caption for the dialog box.
The item list consists of one or more DLGITEMTEMPLATE data structures, one for each control in the dialog box.