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.
MENU (1.2)
◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
The Resource Compiler MENU Statement
MENU menu-id [load-option] [mem-option]
BEGIN
menuitem-definition
.
.
.
END
The MENU statement defines the contents of a menu resource. A menu resource
is a collection of information that defines the appearance and function of
an application menu. A menu is a special input tool that lets a user choose
commands from a list of command names. A menu resource can be loaded from
the executable file when needed by using the WinLoadMenu function.
You can provide any number of MENU statements in a resource-definition file,
but each statement must specify a unique menu-id value. You can provide any
number of menu-item definitions in the menu. These define the submenus and
menu items (commands) in the menu. The order of the definitions defines the
order of the menu items.
Field Description
────────────────────────────────────────────────────────────────────────────
menu-id Specifies the menu-resource 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:
Value Meaning
───────────────────────────────────────────────────────
PRELOAD System loads the resource when the
application starts.
LOADONCALL System loads the resource when the
application calls the WinLoadMenu 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:
Value 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.
menuitem-definition Specifies a PRESPARAMS, MENUITEM, or SUBMENU statement.
You can use one or more PRESPARAMS statements to
control the appearance of a menu, such as the font and
the foreground and background colors. If used,
PRESPARAMS statements must be the first statements
following the BEGIN keyword. For details about the
PRESPARAMS statement, see the PRESPARAMS topic. The
MENUITEM and SUBMENU statements define the individual
commands or submenus in the given menu. For details
about these statements, see the MENUITEM and SUBMENU
topics.
Example
This example creates a menu resource whose menu identifier is 1. The menu
contains a menu item named "Alpha" and a submenu named "Beta". The submenu
contains two menu items, Item 1 and Item 2.
MENU 1
BEGIN
MENUITEM "Alpha", 100
SUBMENU "Beta", 101
BEGIN
MENUITEM "Item 1", 200
MENUITEM "Item 2", 201, , MIA_CHECKED
END
END
See Also
MENUITEM, PRESPARAMS, SUBMENU, WinLoadMenu
♦