This example sends an MM_QUERYITEMATTR message to find the state of the 'idCase' menu item. It then toggles the state of the item and sends an MM_SETITEMATTR message to set the new state.
sState = (SHORT) WinSendMsg(hwndMenu, MM_QUERYITEMATTR, MPFROM2SHORT(idCase, TRUE), MPFROMSHORT(MIA_CHECKED)); sState ^= MIA_CHECKED; WinSendMsg(hwndMenu, MM_SETITEMATTR, MPFROM2SHORT(idCase, TRUE), MPFROM2SHORT(MIA_CHECKED, sState));