Windows Dev Center

DLGITEMTEMPLATEEX structure

A block of text used by an extended dialog box template to describe the extended dialog box. For a description of the format of an extended dialog box template, see DLGTEMPLATEEX.

Syntax


typedef struct {
  DWORD     helpID;
  DWORD     exStyle;
  DWORD     style;
  short     x;
  short     y;
  short     cx;
  short     cy;
  DWORD     id;
  sz_Or_Ord windowClass;
  sz_Or_Ord title;
  WORD      extraCount;
} DLGITEMTEMPLATEEX;

Members

helpID

Type: DWORD

The help context identifier for the control. When the system sends a WM_HELP message, it passes the helpID value in the dwContextId member of the HELPINFO structure.

exStyle

Type: DWORD

The extended styles for a window. This member is not used to create controls in dialog boxes, but applications that use dialog box templates can use it to create other types of windows. For a list of values, see Extended Window Styles.

style

Type: DWORD

The style of the control. This member can be a combination of window style values (such as WS_BORDER) and one or more of the control style values (such as BS_PUSHBUTTON and ES_LEFT).

x

Type: short

The x-coordinate, in dialog box units, of the upper-left corner of the control. This coordinate is always relative to the upper-left corner of the dialog box's client area.

y

Type: short

The y-coordinate, in dialog box units, of the upper-left corner of the control. This coordinate is always relative to the upper-left corner of the dialog box's client area.

cx

Type: short

The width, in dialog box units, of the control.

cy

Type: short

The height, in dialog box units, of the control.

id

Type: DWORD

The control identifier.

windowClass

Type: sz_Or_Ord

A variable-length array of 16-bit elements that specifies the window class of the control. If the first element of this array is any value other than 0xFFFF, the system treats the array as a null-terminated Unicode string that specifies the name of a registered window class.

If the first element is 0xFFFF, the array has one additional element that specifies the ordinal value of a predefined system class. The ordinal can be one of the following atom values.

ValueMeaning
0x0080

Button

0x0081

Edit

0x0082

Static

0x0083

List box

0x0084

Scroll bar

0x0085

Combo box

 

title

Type: sz_Or_Ord

A variable-length array of 16-bit elements that contains the initial text or resource identifier of the control. If the first element of this array is 0xFFFF, the array has one additional element that specifies the ordinal value of a resource, such as an icon, in an executable file. You can use a resource identifier for controls, such as static icon controls, that load and display an icon or other resource rather than text. If the first element is any value other than 0xFFFF, the system treats the array as a null-terminated Unicode string that specifies the initial text.

extraCount

Type: WORD

The number of bytes of creation data that follow this member. If this value is greater than zero, the creation data begins at the next WORD boundary. This creation data can be of any size and format. The control's window procedure must be able to interpret the data. When the system creates the control, it passes a pointer to this data in the lParam parameter of the WM_CREATE message that it sends to the control.

Remarks

An extended template for a dialog box consists of a DLGTEMPLATEEX header followed by a DLGITEMTEMPLATEEX structure for each control in the dialog box.

Each DLGITEMTEMPLATEEX structure must be aligned on a DWORD boundary. The variable-length windowClass and title arrays must be aligned on WORD boundaries. The creation data array, if any, must be aligned on a WORD boundary.

If you specify character strings in the windowClass and title arrays, you must use Unicode strings. Use the MultiByteToWideChar function to generate Unicode strings from ANSI strings.

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

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

See also

Reference
CreateDialogIndirect
CreateDialogIndirectParam
CreateWindowEx
DialogBoxIndirect
DialogBoxIndirectParam
DLGTEMPLATEEX
MapDialogRect
WM_CREATE
Conceptual
Dialog Boxes
Other Resources
MultiByteToWideChar
WM_HELP

 

 

Community Additions

ADD
Show:
© 2015 Microsoft