DLGTEMPLATE Statement
Syntax:
DLGTEMPLATE dialog-id [load-option] [mem-option] [codepage]
BEGIN
dialog-definition
.
.
.
END
The DLGTEMPLATE statement creates a dialog-box template. A dialog-box template
consists of a series of statements that define the identifier, load and
memory options, dialog-box dimensions, and controls in the dialog box. The
dialog-box template can be loaded from the executable file by using the
WinLoadDlg function.
You can provide any number of dialog-box templates in a resource script
file, but each template must have a unique dialog-id value.
dialog-id
Specifies the dialog-box identifier.
This value must be an unsigned integer in the range of 1 through 65535,
a simple expression that evaluates to a value in these ranges, or a character
string.
load-option
Specifies when the system loads
the resource from the executable file into memory. This value must be one
of the following: PRELOAD
System
loads the resource when the application starts.
LOADONCALL
System loads the resource when the
application calls the WinLoadDlg function. This is the default option.
mem-option
Specifies how the system manages
the resource when it is in memory. This value must be one or more of the
following: FIXED
System keeps
the resource at a fixed memory location.
MOVEABLE
System moves the resource as necessary
to compact memory.
DISCARDABLE
System discards the resource if
it is no longer needed. The default setting is MOVEABLE
and DISCARDABLE.
codepage
dialog-definition
Specifies a DIALOG statement.
The statement defines the dimensions and style of the given dialog box.
For details about the statement, see DIALOG
Statement.
Comments
A DLGTEMPLATE statement can actually contain DIALOG, CONTROL, and WINDOW
statements. Typically, you include only one DIALOG statement.
Example
This example uses a DLGTEMPLATE statement to create a dialog box.
DLGTEMPLATE ID_GETTIMERBEGIN
DIALOG "Timer", 1, 10, 10, 100, 40
BEGIN
LTEXT "Time (0 - 15):", 4, 8, 24, 72, 12
ENTRYFIELD "0", ID_TIME, 80, 28, 16, 8, ES_MARGIN
DEFPUSHBUTTON "Enter", ID_TIMEOK, 10, 6, 36, 12
PUSHBUTTON "Cancel", ID_TIMECANCEL, 52, 6, 40, 12
END
END
[Back: DLGINCLUDE Statement]
[Next: EDITTEXT Statement]