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 defines the dimensions and style of a control in a dialog box. One or more of these structures are combined with a DLGTEMPLATEstructure to form a dialog box template.
typedef struct { DWORD style ; DWORD dwExtendedStyle ; short x ; short y ; short cx ; short cy ; WORD id ; } DLGITEMTEMPLATE;
Members
Remarks
In a standard template for a dialog box, the DLGITEMTEMPLATEstructure 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 DLGITEMTEMPLATEstructure in the template must be aligned on a DWORDboundary. The class and title arrays must be aligned on WORDboundaries. The creation data array must be aligned on a WORDboundary.
Immediately following each DLGITEMTEMPLATEstructure is a class array that identifies 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 atom values shown in the following table.
Value | Description |
---|---|
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 WORDboundary 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 lParamparameter 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. 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.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | 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, CreateWindowEx, DialogBoxIndirect, DialogBoxIndirectParam, MapDialogRect, MultiByteToWideChar, DLGTEMPLATE