UINT uCheck = 0;
UINT uEnable = MF_BYCOMMAND; if((pUIData->m_wState & UPDUI_DISABLED) != 0) uEnable |= MF_GRAYED; else uEnable |= MF_ENABLED; ::EnableMenuItem(hMenu, nID, uEnable);
	static void UIUpdateMenuBarElement(int nID, _AtlUpdateUIData* pUIData, HMENU hMenu)	{#ifndef _WIN32_WCE		if((pUIData->m_wState & UPDUI_CLEARDEFAULT) != 0)		{			::SetMenuDefaultItem(hMenu, (UINT)-1, 0);			pUIData->m_wState &= ~UPDUI_CLEARDEFAULT;		}#endif //!_WIN32_WCE		CMenuItemInfo mii;		mii.fMask = MIIM_STATE;		mii.wID = nID;		if(pUIData->m_wState & UPDUI_DISABLED)#ifndef _WIN32_WCE			mii.fState |= MFS_DISABLED | MFS_GRAYED;#else // CE specific			mii.fState &= ~MFS_ENABLED;#endif //_WIN32_WCE		else			mii.fState |= MFS_ENABLED;#ifndef _WIN32_WCE		if(pUIData->m_wState & UPDUI_CHECKED)			mii.fState |= MFS_CHECKED;		else			mii.fState |= MFS_UNCHECKED;#else // CE specific		UINT uCheck = 0;		if(pUIData->m_wState & UPDUI_CHECKED)			uCheck |= MF_CHECKED;		else			uCheck |= MF_UNCHECKED;		// SetMenuItemInfo can not set the check mark bitmaps		// Have to use CheckMenuItem instead		::CheckMenuItem(hMenu, nID, uCheck);#endif //_WIN32_WCE#ifndef _WIN32_WCE		if(pUIData->m_wState & UPDUI_DEFAULT)			mii.fState |= MFS_DEFAULT;#endif //!_WIN32_WCE		if(pUIData->m_wState & UPDUI_TEXT)		{			CMenuItemInfo miiNow;			miiNow.fMask = MIIM_TYPE;			miiNow.wID = nID;			if(::GetMenuItemInfo(hMenu, nID, FALSE, &miiNow))			{				mii.fMask |= MIIM_TYPE;				// MFT_BITMAP and MFT_SEPARATOR don't go together with MFT_STRING#ifndef _WIN32_WCE				mii.fType |= (miiNow.fType & ~(MFT_BITMAP | MFT_SEPARATOR)) | MFT_STRING;#else // CE specific				mii.fType |= (miiNow.fType & ~(MFT_SEPARATOR)) | MFT_STRING;#endif //_WIN32_WCE				mii.dwTypeData = (LPTSTR)pUIData->m_lpData;			}		}		::SetMenuItemInfo(hMenu, nID, FALSE, &mii);	}