Have menu with some item, need change it to MF_CHECKED
or MF_UNCHECKED
.
And how to check up what item of menu is checked now?
You can retrieve the check state among other information by calling GetMenuItemInfo
. It fills a MENUITEMINFO
structure. It's fState
member will have the MFS_CHECKED
flag set, if the menu item is checked.
To modify the check state of a menu item you call SetMenuItemInfo
. There is also a utility function CheckMenuItem
. The docs state that this API call may not be available in versions after Windows 2000. However, it still is.
Just keeping the state of the menu in your own variables is the straight-forward solution. But you can use GetMenuItemInfo() to retrieve the state of a menu item, MENUITEMINFO.fState field.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With