Microsoft Windows CE 3.0  

DLGTEMPLATEEX

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This structure is not defined in any standard header file. The structure definition is provided here to explain the format of an extended template for a dialog box.

An extended dialog box template begins with a DLGTEMPLATEEXheader that describes the dialog box and specifies the number of controls in the dialog box. For each control in a dialog box, an extended dialog box template has a block of data that uses the DLGITEMTEMPLATEEXformat to describe the control.

typedef
struct
{
WORD
dlgVer; 
WORD
signature
;
DWORD
helpID
;
DWORD
exStyle
;
DWORD
style
;
WORD
cDlgItems
;
short
x; 
short
y
;
short
cx
;
short
cy
;
sz_Or_Ord
menu
;
sz_Or_Ord
windowClass
;
WCHAR
title[titleLen]
;
short
pointsize
;
short
weight
;
short
bItalic
;
WCHAR
font[fontLen]
;
}
DLGTEMPLATEEX;

Members

dlgVer
Specifies the version number of the extended dialog box template. This member must specify 1.
signature
Indicates whether a template is an extended dialog box template. A value of 0xFFFF indicates an extended dialog box template. In this case, the dlgVermember specifies the template version number. If signatureis any value other than 0xFFFF, this is a standard template that uses the DLGTEMPLATEand DLGITEMTEMPLATEstructures.
helpID
Specifies the help context identifier for the dialog box window. When the system sends a WM_HELP message, it passes this value in the dwContextIdmember of the HELPINFOstructure.
exStyle
Specifies extended styles for a window. This member is not used to create dialog boxes, but applications that use dialog box templates can use it to create other types of windows.
style
Specifies the style of the dialog box. This member can be a combination of window style values (such as WS_CAPTION and WS_SYSMENU) and one or more of the dialog box style values shown in the following table.
Value Description
DS_3DLOOK Gives the dialog box a nonbold font and draws three-dimensional borders around control windows in the dialog box.
DS_ABSALIGN Indicates that the coordinates of the dialog box are screen coordinates. If this style is not specified, the system recognizes them as client coordinates.
DS_CENTER Centers the dialog box in the working area; that is, the area not obscured by the tray
DS_CENTERMOUSE Centers the mouse cursor in the dialog box
DS_CONTEXTHELP Includes a question mark in the title bar of the dialog box. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message. The control should pass the message to the dialog procedure, which should call the WinHelpfunction using the HELP_WM_HELP command. The help application displays a pop-up window that typically contains help for the control.

Note that DS_CONTEXTHELP is only a placeholder. When the dialog box is created, the system checks for DS_CONTEXTHELP and, if it is there, adds WS_EX_CONTEXTHELP to the extended style of the dialog box. You cannot use the WS_EX_CONTEXTHELP style with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.

DS_CONTROL Creates a dialog box that works well as a child window of another dialog box, much like a page in a property sheet. This style allows the user to tab among the control windows of a child dialog box, use its accelerator keys, and so on.
DS_MODALFRAME Creates a dialog box with a modal dialog-box frame that can be combined with a title bar and windowmenu by specifying the WS_CAPTION and WS_SYSMENU styles
DS_NOFAILCREATE Creates the dialog box even if errors occur—for example, if a child window cannot be created or if the system cannot create a special data segment for an edit control.
DS_NOIDLEMSG Suppresses WM_ENTERIDLE messages that the system would otherwise send to the owner of the dialog box while the dialog box is displayed.
DS_SETFONT Indicates that the DLGTEMPLATEEXheader of the extended dialog box template contains four additional members ( pointsize, weight, bItalic, and font) that describe the font to use for the text in the client area and controls of the dialog box. If possible, the system creates a font according to the values specified in these members. Then the system passes the handle of the font to the dialog box and to each control by sending them the WM_SETFONT message.

If this style is not specified, the extended dialog box template does not include the pointsize, weight, bItalic, and fontmembers.

DS_SETFOREGROUND Causes the system to use the SetForegroundWindowfunction to bring the dialog box to the foreground
cDlgItems
Specifies the number of controls in the dialog box
x
Specifies the x-coordinate, in dialog box units, of the upper-left corner of the dialog box
y
Specifies the y-coordinate, in dialog box units, of the upper-left corner of the dialog box
cx
Specifies the width, in dialog box units, of the dialog box
cy
Specifies the height, in dialog box units, of the dialog box
menu
Specifies a variable-length array of 16-bit elements that identifies a menu resource for the dialog box. If the first element of this array is 0x0000, the dialog box has no menu and the array has no other elements. If the first element is 0xFFFF, the array has one additional element that specifies the ordinal value of a menu resource in an executable file. If the first element has any other value, the system treats the array as a null-terminated Unicode string that specifies the name of a menu resource in an executable file.
windowClass
Specifies a variable-length array of 16-bit elements that identifies the window class of the dialog box. If the first element of the array is 0x0000, the system uses the predefined dialog box class for the dialog box and the array has no other elements. If the first element is 0xFFFF, the array has one additional element that specifies the ordinal value of a predefined system window class. If the first element has any other value, the system treats the array as a null-terminated Unicode string that specifies the name of a registered window class.
title
Specifies a null-terminated Unicode string that contains the title of the dialog box. If the first element of this array is 0x0000, the dialog box has no title and the array has no other elements.
pointsize
Specifies the point size of the font to use for the text in the dialog box and its controls. The pointsize, weight, bItalic, and fontmembers are present in an extended dialog box template only if the stylemember specifies the DS_SETFONT style.
weight
Specifies the weight of the font in the range 0 through 1000. This can be any of the values listed for the lfWeightmember of the LOGFONTstructure. This member is present only if the stylemember specifies DS_SETFONT.
bItalic
Indicates whether the font is italic. If this value is TRUE, the font is italic. This member is present only if the stylemember specifies DS_SETFONT.
font
Specifies a null-terminated Unicode string that contains the name of the typeface for the font. This member is present only if the stylemember specifies DS_SETFONT.

Remarks

You can use an extended dialog box template instead of a standard dialog box template in the CreateDialogIndirectParamand DialogBoxIndirectParamfunctions and the CreateDialogIndirectand DialogBoxIndirectmacros. A standard dialog box template uses the DLGTEMPLATEand DLGITEMTEMPLATEstructures.

Following the DLGTEMPLATEEXheader in an extended dialog box template is one or more DLGITEMTEMPLATEEXstructures that describe the controls of the dialog box. The cDlgItemsmember specifies the number of DLGITEMTEMPLATEEXstructures in the template.

Each DLGITEMTEMPLATEEXstructure in the template must be aligned on a DWORDboundary. If the stylemember specifies the DS_SETFONT style, the first DLGITEMTEMPLATEEXstructure begins on the first DWORDboundary after the fontstring. If DS_SETFONT is not specified, the first structure begins on the first DWORDboundary after the titlestring.

The menu, windowClass, title, and fontarrays must be aligned on WORDboundaries.

If you specify character strings in the menu, windowClass, title, and fontarrays, you must use Unicode strings. To create code that works on both Windows 95/98 and Windows NT, use the MultiByteToWideCharfunction to generate these Unicode strings.

The x, y, cx, and cymembers specify values in dialog box units. You can convert these values to screen units (pixels) by using the MapDialogRectfunction.

The following dwStyleflags are not supported for dialog boxes:

Unsupported dialog box styles
DS_ABSALIGN
DS_CENTERMOUSE
DS_CONTEXTHELP
DS_FIXEDSYS
DS_NOFAILCREATE
DS_NOIDLEMSG
DS_SYSMODAL

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS   Winuser.h    
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CreateDialogIndirect, CreateDialogIndirectParam, DialogBoxIndirect, DialogBoxIndirectParam, MapDialogRect, MultiByteToWideChar, WM_SETFONT, DLGITEMTEMPLATE, DLGITEMTEMPLATEEX, DLGTEMPLATE, LOGFONT