Skip to content

Latest commit

 

History

History
218 lines (138 loc) · 7.63 KB

ns-winuser-dlgitemtemplate.md

File metadata and controls

218 lines (138 loc) · 7.63 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NS:winuser.DLGITEMTEMPLATE
DLGITEMTEMPLATE (winuser.h)
Defines the dimensions and style of a control in a dialog box. One or more of these structures are combined with a DLGTEMPLATE structure to form a standard template for a dialog box.
*LPDLGITEMTEMPLATEA
*LPDLGITEMTEMPLATEW
*PDLGITEMTEMPLATEA
*PDLGITEMTEMPLATEW
DLGITEMTEMPLATE
DLGITEMTEMPLATE structure [Dialog Boxes]
PDLGITEMTEMPLATE
PDLGITEMTEMPLATE structure pointer [Dialog Boxes]
_win32_DLGITEMTEMPLATE_str
_win32_dlgitemtemplate_str_cpp
dlgbox.dlgitemtemplate
winui._win32_dlgitemtemplate_str
winuser/DLGITEMTEMPLATE
winuser/PDLGITEMTEMPLATE
dlgbox\dlgitemtemplate.htm
dlgbox
VS|winui|~\winui\windowsuserinterface\windowing\dialogboxes\dialogboxreference\dialogboxstructures\dlgitemtemplate.htm
12/05/2018
*LPDLGITEMTEMPLATEA, *LPDLGITEMTEMPLATEW, *PDLGITEMTEMPLATEA, *PDLGITEMTEMPLATEW, DLGITEMTEMPLATE, DLGITEMTEMPLATE structure [Dialog Boxes], PDLGITEMTEMPLATE, PDLGITEMTEMPLATE structure pointer [Dialog Boxes], _win32_DLGITEMTEMPLATE_str, _win32_dlgitemtemplate_str_cpp, dlgbox.dlgitemtemplate, winui._win32_dlgitemtemplate_str, winuser/DLGITEMTEMPLATE, winuser/PDLGITEMTEMPLATE
winuser.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
Windows
DLGITEMTEMPLATE
19H1
DLGITEMTEMPLATE
winuser/DLGITEMTEMPLATE
c++
APIRef
kbSyntax
HeaderDef
Winuser.h
DLGITEMTEMPLATE

DLGITEMTEMPLATE structure

-description

Defines the dimensions and style of a control in a dialog box. One or more of these structures are combined with a DLGTEMPLATE structure to form a standard template for a dialog box.

-struct-fields

-field 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).

-field dwExtendedStyle

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.

-field 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.

-field 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.

-field cx

Type: short

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

-field cy

Type: short

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

-field id

Type: WORD

The control identifier.

-remarks

In a standard template for a dialog box, the DLGITEMTEMPLATE structure is always immediately followed by three variable-length arrays specifying the class, title, and creation data for the control. Each array consists of one or more 16-bit elements.

Each DLGITEMTEMPLATE structure in the template must be aligned on a DWORD boundary. The class and title arrays must be aligned on WORD boundaries. The creation data array must be aligned on a WORD boundary.

Immediately following each DLGITEMTEMPLATE structure is a class array 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.

Value Meaning
0x0080 Button
0x0081 Edit
0x0082 Static
0x0083 List box
0x0084 Scroll bar
0x0085 Combo box
 

Following the class array is a title array 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 an 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.

The creation data array begins at the next WORD boundary after the title array. This creation data can be of any size and format. If the first word of the creation data array is nonzero, it indicates the size, in bytes, of the creation data (including the size word). 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.

If you specify character strings in the class 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.

-see-also

Conceptual

CreateDialogIndirect

CreateDialogIndirectParam

CreateWindowEx

DLGITEMTEMPLATEEX

DLGTEMPLATE

DLGTEMPLATEEX

Dialog Boxes

DialogBoxIndirect

DialogBoxIndirectParam

MapDialogRect

MultiByteToWideChar

Other Resources

Reference

WM_CREATE