POPUPMENUITEM structure
Contains information about the menu items in a menu resource that open a menu or a submenu. The structure definition provided here is for explanation only; it is not present in any standard header file.
Syntax
typedef struct {
DWORD type;
DWORD state;
DWORD id;
WORD resInfo;
szOrOrd menuText;
} POPUPMENUITEM;
Members
-
type
-
Type: DWORD
-
Describes the menu item. Some of the values this member can have include those shown in the list below.
In addition to the values shown, this member can also be a combination of the type values listed with the fType 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"
Value Meaning - MF_END
- 0x80
The menu item is the last on the menu; the flag is used internally by the system. - MF_POPUP
- 0x01
The menu item opens a menu or a submenu; the flag is used internally by the system. -
state
-
Type: DWORD
-
Describes 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
-
Type: DWORD
-
A numeric expression that identifies the menu item that is passed in the WM_COMMAND message.
-
resInfo
-
Type: WORD
-
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
- 0x80
The menu item is the last in this submenu or menu resource; this flag is used internally by the system. - MFR_POPUP
- 0x01
The menu item opens a menu or a submenu; the flag is used internally by the system. -
menuText
-
Type: szOrOrd
-
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.
Requirements
Requirement | Value |
---|---|
Minimum supported client |
Windows 2000 Professional [desktop apps only] |
Minimum supported server |
Windows 2000 Server [desktop apps only] |
See also
-
Reference
-
Conceptual