please dont rip this site Prev Next

GetMenuState info  Overview  Group

The GetMenuState function retrieves the menu flags associated with the specified menu item. If the menu item opens a submenu, this function also returns the number of items in the submenu.

The GetMenuState function has been superseded by the GetMenuItemInfo function. You can still use GetMenuState, however, if you do not need any of the extended features of GetMenuItemInfo.

UINT GetMenuState(

    HMENU hMenu,

// handle of menu

    UINT uId,

// menu item to query

    UINT uFlags

// menu flags



Identifies the menu that contains the menu item whose flags are to be retrieved.
Specifies the menu item for which the menu flags are to be retrieved, as determined by the uFlags parameter.
Specifies how the uId parameter is interpreted. This parameter can be one of the following values:




Indicates that the uId parameter gives the identifier of the menu item. The MF_BYCOMMAND flag is the default if neither the MF_BYCOMMAND nor MF_BYPOSITION flag is specified.


Indicates that the uId parameter gives the zero-based relative position of the menu item.

Return Values

If the specified item does not exist, the return value is 0xFFFFFFFF.

If the menu item opens a submenu, the low-order byte of the return value contains the menu flags associated with the item, and the high-order byte contains the number of items in the submenu opened by the item.

Otherwise, the return value is a mask (Boolean OR) of the menu flags. Following are the menu flags associated with the menu item.




Places a check mark next to the item (for drop-down menus, submenus, and shortcut menus only).


Disables the item.


Disables and grays the item.


Highlights the item.


Functions the same as the MF_MENUBREAK flag, except for drop-down menus, submenus, and shortcut menus, where the new column is separated from the old column by a vertical line.


Places the item on a new line (for menu bars) or in a new column (for drop-down menus, submenus, and shortcut menus) without separating columns.


Creates a horizontal dividing line (for drop-down menus, submenus, and shortcut menus only).

See Also

GetMenu, GetMenuItemCount, GetMenuItemID, GetMenuItemInfo

See also:

file: /Techref/os/win/api/win32/func/src/f34_12.htm, 5KB, , updated: 2000/4/7 12:19, local time: 2022/5/23 17:00,

 ©2022 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> GetMenuState</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

  PICList 2022 contributors:
o List host: MIT, Site host, Top posters @20220523
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.

Welcome to!