This section describes how to define dialog and window templates.
It also describes the control data and presentation parameter structures that the application needs to create windows and define dialog templates.
DLGTEMPLATE and WINDOWTEMPLATE statements are used by an application to create predefined window and dialog resource templates. These statements are treated identically by the resource compiler and have the following format:
───┬─DLGTEMPLATE─────┬──resourceid───────── └─WINDOWTEMPLATE──┘ ────┬───────────┬┬───────────┬┬──────────┬── └loadoption─┘└─memoption─┘└─codepage─┘ ───BEGIN──┬──DIALOG statement───┬───END─── ├──CONTROL statement──┤ └──WINDOW statement───┘
In the following description of the parts of the DLGTEMPLATE and WINDOWTEMPLATE statements, data types are shown after each parameter or option. These are the data types that the parameter or option is converted to when it is compiled.
Purpose
See Resource Load and Memory Options for a description of LOADOPTION.
See Resource Load and Memory Options for a description of MEMOPTION.
Alternatively, ({) can be used in place of BEGIN and (}) in place of END.
The DLGTEMPLATE and WINDOWTEMPLATE keywords are synonymous.
The DIALOG statement defines a dialog-box window that can be created by an application and has the following format:
───DIALOG───text─,─id─,─x─,─y─,─cx─,─cy──── ───────┬───────────────────┬──────────────── └─,style─┬──────────┤ └─,control─┘ ──────────────────┬┬───────────────────────┬ │ ││┌─────────────────────┐│ │ ││ ││ └CTLDATA─statement┘└─PRESPARAMS─statement─┴┘ ┌────────────────────────┐ │ ─BEGIN─────┬──DIALOG─statement──┬─┴──END─── ├──CONTROL─statement─┤ └──WINDOW─statement──┘
The WINDOW and CONTROL statements have the format:
─┬─WINDOW─┬─text,─id,─x,─y,─cx,─cy,─class── └─CONTROL┘ ──┬──────────────────────────┬──── └───,style───┬─────────────┤ └──,control───┘ ──────────────────┬┬───────────────────────┬ │ ││┌─────────────────────┐│ │ ││ ││ └CTLDATA─statement┘└─PRESPARAMS─statement─┴┘ ┌────────────────────────┐ │ ─BEGIN─────┬──DIALOG─statement──┬─┴──END─── ├──CONTROL─statement─┤ └──WINDOW─statement──┘
Note: The WINDOW and CONTROL keywords are synonymous.
The DIALOG, CONTROL, and WINDOW statements between the BEGIN and END statements are defined as child windows. Presentation parameters always apply to the whole control. They cannot be changed for the individual items within the control.
Following is the description of the parameters for these statements.
Purpose
Note: Not all values may be specified for each statement type. For details, see the call syntax diagrams.
Note: For a DIALOG statement the class is fixed as WC_FRAME and cannot be specified.
The default style is WS_SYNCPAINT | WS_CLIPSIBLINGS | WS_SAVEBITS | FS_DLGBORDER. If the FS_DLGBORDER or WS_SAVEBITS styles are not required, they should be preceded by the keyword "NOT". For example:
NOT FS_DLGBORDER | FS_BORDER | NOT WS_SAVEBITS
replaces the FS_DLGBORDER default style by the FS_BORDER style and removes the WS_SAVEBITS style. Note that the logic of the NOT keyword is different from the corresponding operator in the C language.
It is not possible to remove the default WS_SYNCPAINT and WS_CLIPSIBLINGS styles. control (ULONG)
This data is placed in the control data field in the correct format for a window of class WC_FRAME.
Note: FCF_SHELLPOSITION has no effect if specified in a template.