A SERVICE OF

logo

C H A P T E R
7
Menu objects
See the
For many applications, all you need is a simple menu that you assign to the
ObjectWindows
main window during its initialization. Other applications might require
Reference Guide
for
more complicated menu handling. ObjectWindows menu objects (the
a description of
TMenuDescr
.
TMenu, TSystemMenu, and TP pupMenu classes, and the TMenuDescro
structure) give you an easy way to create and manipulate menus.
This chapter discusses the following tasks you can perform with menu
objects:
Constructing menu objects
Modifying menu objects
Querying menu objects
Using system menu objects
Using pop-up menu objects
Constructing menu objects
TMenu has several constructors to create menu objects from existing
windows or from menu resources. After the menu is created, you can add,
delete, or modify it using TMenu member functions. The table below lists
the constructors you can use to create menu objects.
__________________________________________________________________________
Table 7.1
TMenu
constructor Description
TMenu constructors
____________________________________________________________________
for creating menu
TMenu()
Creates an empty menu.
objects
TMenu(HWND)
Creates a menu object representing the window’ current menu.s
TMenu(HMENU)
Creates a menu object from an already-loaded menu.
TMenu(LPCVOID*)
Creates a menu object from a menu template in memory.
TMenu(HINST NCE, TResID)
Creates a menu object from a resource.
A
____________________________________________________________________
Chapter 7, Menu objects
171