Home   Index   About
Ultimate Pack


Custom Search
Overview
Group
Quick Info

PopupMenuItem

The PopupMenuItem structure contains information about the menu items in a menu resource that open a menu or a submenu.

struct PopupMenuItem {

DWORD type;

DWORD state;

DWORD id;

WORD resInfo;

szOrOrd menuText;

};

Members

type

Specifies a set of type flags that you can use to describe the menu item. Some of the values this member can have include:

Value
Meaning
MF_END
The menu item is the last on the menu; the flag is used internally by the system.
MF_POPUP
The menu item opens a menu or a submenu; the flag is used internally by the system.

If you specify MF_POPUP, it indicates that the menu item is one that opens a menu or a submenu.

In addition to the values MF_END and MF_POPUP, this member can also be a combination of the type values listed with the dwType member of the MENUITEMINFO structure. The type values are those that begin with MFT_. To use these predefined MFT_* type values, include the following statement in your .RC file:

#include "WINUSER.H"

state

Specifies a set of state flags that you can use to describe the menu item. This member can be a combination of the state values listed with the dwState member of the MENUITEMINFO structure. The state values are those that begin with MFS_. To use these predefined MFS_* state values, include the following statement in your .RC file:

#include "WINUSER.H"

id

A numeric expression that identifies the menu item that is passed in the WM_COMMAND message.

resInfo

A set of bit flags that specify the type of menu item. This member can be one of the following values.

Value
Meaning
MFR_END
The menu item is the last in this submenu or menu resource; this flag is used internally by the system.
MFR_POPUP
The menu item opens a menu or a submenu; the flag is used internally by the system.

menuText

Specifies a null-terminated Unicode string that contains the text for this menu item. There is no fixed limit on the size of this string.

Remarks

There is one PopupMenuItem structure for each menu item that opens a menu or a submenu. Identify this type of menu item by setting the type member to MF_POPUP and by setting the MFR_POPUP bit in the resInfo member to 0x0001. In this case, the final data written to the RT_MENU resource for the menu or submenu is the MENUHELPID structure. MENUHELPID contains a numeric expression that identifies the menu during WM_HELP processing.

Additionally, every PopupMenuItem structure that has the MFR_POPUP bit set in the resInfo member will be followed by a MENUHELPID structure plus an additional number of PopupMenuItem structures, one for each menu item in that submenu. The last PopupMenuItem structure in the submenu will have the MFR_END bit set in the resInfo member. To find the end of the resource, look for a matching MFR_END for every MFR_POPUP plus one additional MFR_END that matches the outermost set of menu items.

Indicate the last menu item by setting the type member to MF_END. Because you can nest submenus, there can be multiple levels of MF_END. In these instances, the menu items are sequential.

See Also

MenuHeader
, MENUHELPID, MENUITEMINFO, NormalMenuItem


Last news from Greatis Software

Nostalgia .Net     Nostalgia .Net     .Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes.  More »

Recommended software for developers

Ultimate Pack for Delphi and C++ Builder     Ultimate Pack     Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price.  More »

Form Designer .Net     Form Designer .Net     Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro!  More »

Print Suite .Net     Print Suite .Net     Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available  More »

Gradient Controls .Net     Gradient Controls .Net     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     Greatis iGrid     iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors.  More »


All the contacts and projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software for Visual Studio .NET developers
Software for Delphi and C++ Builder developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET

More Online Helps

Win32 Programmer's Reference
Win32 Multimedia Programmer's Reference
OLE Programmer's Reference
Microsoft Windows Pen API Programmer's Reference
Microsoft Windows Sockets 2 Reference
Microsoft Windows Telephony API (TAPI) Programmer's Reference
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008-2011 Free Tech Secrets ;) greatis just4fun network just4fun