Is there a simple message to send a menu(from resource) to see if the menu item is checked?
Is there a simple message to send a menu(from resource) to see if the menu item is checked?
Code:(GetMenuState(hMenu, IDCMD_PLAYCHICKEN, MF_BYCOMMAND) & MF_CHECKED)
Heh, thanks that worked.
What do you do when you specify the MF_BYPOSITION flag?I am not really sure where to use MF_BYCOMMAND or MF_BYPOSITION like MF_BYCOMMAND sometimes works and I just used the menu identifier for the 2nd paramater, what do I put for MF_BYPOSITION?
You just use the zero-based position of the menu item. For example, if you wanted to check the second menu item, you would use the value 1. I imagine it would usually be more convernient to use MF_BYCOMMAND with the identifier.
maybe this is unrelated to a CheckMenuItem() problem but why doesnt this work?
Code:case WM_CLOSE: if(GetFocus() == hwndtreeparent){ HMENU hMenu; hMenu = GetMenu(hwnd); CheckMenuItem(hMenu, IDM_VIEW_WORK, MF_UNCHECKED); ShowWindow(hwndtreeparent, SW_HIDE); return 0; } break;