Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
DLGTEMPLATE (1.2)
◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
The Resource Compiler DLGTEMPLATE Statement
DLGTEMPLATE dialog-id [load-option] [mem-option]
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-definition
file, but each template must have a unique dialog-id value.
Field Description
────────────────────────────────────────────────────────────────────────────
dialog-id Specifies the dialog-box identifier. This value must be
an integer in the range 0 through 65,535, or a simple
expression that evaluates to a value in that range.
load-option Specifies when the system loads the resource from the
executable file into memory. This value must be one of
the following:
Option Meaning
─────────────────────────────────────────────────────────
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 value.
mem-option Specifies how the system manages the resource when it is
in memory. This value must be one or more of the
following:
Option Meaning
─────────────────────────────────────────────────────────
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.
dialog-definition Specifies a DIALOG statement. The statement defines the
dimensions and style of the given dialog box. For details
about the statement, see the DIALOG topic.
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_GETTIMER
BEGIN
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
See Also
CONTROL, DIALOG, WINDOW, WinLoadDlg
♦