mirror of
https://github.com/reactos/reactos.git
synced 2024-07-31 00:28:56 +00:00
removed MENUITEMINFOW struct from MENU_ITEM
svn path=/trunk/; revision=5646
This commit is contained in:
parent
f56db0bd84
commit
b2b074bf8c
|
@ -17,11 +17,20 @@
|
||||||
#ifndef MIIM_STRING
|
#ifndef MIIM_STRING
|
||||||
#define MIIM_STRING (0x00000040)
|
#define MIIM_STRING (0x00000040)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _MENU_ITEM
|
typedef struct _MENU_ITEM
|
||||||
{
|
{
|
||||||
struct _MENU_ITEM *Next;
|
struct _MENU_ITEM *Next;
|
||||||
MENUITEMINFOW MenuItem;
|
UINT fType;
|
||||||
|
UINT fState;
|
||||||
|
UINT wID;
|
||||||
|
HMENU hSubMenu;
|
||||||
|
HBITMAP hbmpChecked;
|
||||||
|
HBITMAP hbmpUnchecked;
|
||||||
|
ULONG_PTR dwItemData;
|
||||||
|
LPWSTR dwTypeData;
|
||||||
|
UINT cch;
|
||||||
|
HBITMAP hbmpItem;
|
||||||
} MENU_ITEM, *PMENU_ITEM;
|
} MENU_ITEM, *PMENU_ITEM;
|
||||||
|
|
||||||
typedef struct _MENU_OBJECT
|
typedef struct _MENU_OBJECT
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: menu.c,v 1.14 2003/08/11 21:10:49 royce Exp $
|
/* $Id: menu.c,v 1.15 2003/08/18 11:58:17 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -79,12 +79,11 @@
|
||||||
|
|
||||||
#define FreeMenuText(MenuItem) \
|
#define FreeMenuText(MenuItem) \
|
||||||
{ \
|
{ \
|
||||||
if(((MenuItem).fMask & (MIIM_TYPE | MIIM_STRING)) && \
|
if((MENU_ITEM_TYPE((MenuItem)->fType) == MF_STRING) && \
|
||||||
(MENU_ITEM_TYPE((MenuItem).fType) == MF_STRING) && \
|
(MenuItem)->dwTypeData) { \
|
||||||
(MenuItem).dwTypeData) { \
|
ExFreePool((MenuItem)->dwTypeData); \
|
||||||
ExFreePool((MenuItem).dwTypeData); \
|
(MenuItem)->dwTypeData = 0; \
|
||||||
(MenuItem).dwTypeData = 0; \
|
(MenuItem)->cch = 0; \
|
||||||
(MenuItem).cch = 0; \
|
|
||||||
DbgPrint("FreeMenuText(): Deleted menu text\n"); \
|
DbgPrint("FreeMenuText(): Deleted menu text\n"); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
@ -108,29 +107,29 @@ DumpMenuItemList(PMENU_ITEM MenuItem)
|
||||||
UINT cnt = 0;
|
UINT cnt = 0;
|
||||||
while(MenuItem)
|
while(MenuItem)
|
||||||
{
|
{
|
||||||
if(MenuItem->MenuItem.dwTypeData)
|
if(MenuItem->dwTypeData)
|
||||||
DbgPrint(" %d. %ws\n", ++cnt, (LPWSTR)MenuItem->MenuItem.dwTypeData);
|
DbgPrint(" %d. %ws\n", ++cnt, (LPWSTR)MenuItem->dwTypeData);
|
||||||
else
|
else
|
||||||
DbgPrint(" %d. NO TEXT dwTypeData==%d\n", ++cnt, MenuItem->MenuItem.dwTypeData);
|
DbgPrint(" %d. NO TEXT dwTypeData==%d\n", ++cnt, MenuItem->dwTypeData);
|
||||||
DbgPrint(" fType=");
|
DbgPrint(" fType=");
|
||||||
if(MFT_BITMAP & MenuItem->MenuItem.fType) DbgPrint("MFT_BITMAP ");
|
if(MFT_BITMAP & MenuItem->fType) DbgPrint("MFT_BITMAP ");
|
||||||
if(MFT_MENUBARBREAK & MenuItem->MenuItem.fType) DbgPrint("MFT_MENUBARBREAK ");
|
if(MFT_MENUBARBREAK & MenuItem->fType) DbgPrint("MFT_MENUBARBREAK ");
|
||||||
if(MFT_MENUBREAK & MenuItem->MenuItem.fType) DbgPrint("MFT_MENUBREAK ");
|
if(MFT_MENUBREAK & MenuItem->fType) DbgPrint("MFT_MENUBREAK ");
|
||||||
if(MFT_OWNERDRAW & MenuItem->MenuItem.fType) DbgPrint("MFT_OWNERDRAW ");
|
if(MFT_OWNERDRAW & MenuItem->fType) DbgPrint("MFT_OWNERDRAW ");
|
||||||
if(MFT_RADIOCHECK & MenuItem->MenuItem.fType) DbgPrint("MFT_RADIOCHECK ");
|
if(MFT_RADIOCHECK & MenuItem->fType) DbgPrint("MFT_RADIOCHECK ");
|
||||||
if(MFT_RIGHTJUSTIFY & MenuItem->MenuItem.fType) DbgPrint("MFT_RIGHTJUSTIFY ");
|
if(MFT_RIGHTJUSTIFY & MenuItem->fType) DbgPrint("MFT_RIGHTJUSTIFY ");
|
||||||
if(MFT_SEPARATOR & MenuItem->MenuItem.fType) DbgPrint("MFT_SEPARATOR ");
|
if(MFT_SEPARATOR & MenuItem->fType) DbgPrint("MFT_SEPARATOR ");
|
||||||
if(MFT_STRING & MenuItem->MenuItem.fType) DbgPrint("MFT_STRING ");
|
if(MFT_STRING & MenuItem->fType) DbgPrint("MFT_STRING ");
|
||||||
DbgPrint("\n fState=");
|
DbgPrint("\n fState=");
|
||||||
if(MFS_DISABLED & MenuItem->MenuItem.fState) DbgPrint("MFS_DISABLED ");
|
if(MFS_DISABLED & MenuItem->fState) DbgPrint("MFS_DISABLED ");
|
||||||
else DbgPrint("MFS_ENABLED ");
|
else DbgPrint("MFS_ENABLED ");
|
||||||
if(MFS_CHECKED & MenuItem->MenuItem.fState) DbgPrint("MFS_CHECKED ");
|
if(MFS_CHECKED & MenuItem->fState) DbgPrint("MFS_CHECKED ");
|
||||||
else DbgPrint("MFS_UNCHECKED ");
|
else DbgPrint("MFS_UNCHECKED ");
|
||||||
if(MFS_HILITE & MenuItem->MenuItem.fState) DbgPrint("MFS_HILITE ");
|
if(MFS_HILITE & MenuItem->fState) DbgPrint("MFS_HILITE ");
|
||||||
else DbgPrint("MFS_UNHILITE ");
|
else DbgPrint("MFS_UNHILITE ");
|
||||||
if(MFS_DEFAULT & MenuItem->MenuItem.fState) DbgPrint("MFS_DEFAULT ");
|
if(MFS_DEFAULT & MenuItem->fState) DbgPrint("MFS_DEFAULT ");
|
||||||
if(MFS_GRAYED & MenuItem->MenuItem.fState) DbgPrint("MFS_GRAYED ");
|
if(MFS_GRAYED & MenuItem->fState) DbgPrint("MFS_GRAYED ");
|
||||||
DbgPrint("\n wId=%d\n", MenuItem->MenuItem.wID);
|
DbgPrint("\n wId=%d\n", MenuItem->wID);
|
||||||
MenuItem = MenuItem->Next;
|
MenuItem = MenuItem->Next;
|
||||||
}
|
}
|
||||||
DbgPrint("Entries: %d\n", cnt);
|
DbgPrint("Entries: %d\n", cnt);
|
||||||
|
@ -162,17 +161,17 @@ BOOL FASTCALL
|
||||||
W32kFreeMenuItem(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem,
|
W32kFreeMenuItem(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem,
|
||||||
BOOL RemoveFromList, BOOL bRecurse)
|
BOOL RemoveFromList, BOOL bRecurse)
|
||||||
{
|
{
|
||||||
FreeMenuText(MenuItem->MenuItem);
|
FreeMenuText(MenuItem);
|
||||||
if(RemoveFromList)
|
if(RemoveFromList)
|
||||||
{
|
{
|
||||||
/* FIXME - Remove from List */
|
/* FIXME - Remove from List */
|
||||||
MenuObject->MenuItemCount--;
|
MenuObject->MenuItemCount--;
|
||||||
}
|
}
|
||||||
if(bRecurse && MenuItem->MenuItem.hSubMenu)
|
if(bRecurse && MenuItem->hSubMenu)
|
||||||
{
|
{
|
||||||
PMENU_OBJECT SubMenuObject;
|
PMENU_OBJECT SubMenuObject;
|
||||||
SubMenuObject = (PMENU_OBJECT)W32kGetWindowObject(
|
SubMenuObject = (PMENU_OBJECT)W32kGetWindowObject(
|
||||||
MenuItem->MenuItem.hSubMenu );
|
MenuItem->hSubMenu );
|
||||||
if(SubMenuObject)
|
if(SubMenuObject)
|
||||||
{
|
{
|
||||||
W32kDestroyMenuObject(SubMenuObject, bRecurse);
|
W32kDestroyMenuObject(SubMenuObject, bRecurse);
|
||||||
|
@ -376,7 +375,7 @@ W32kGetMenuItemByFlag(PMENU_OBJECT MenuObject, UINT uSearchBy, UINT fFlag,
|
||||||
p = 0;
|
p = 0;
|
||||||
while(CurItem)
|
while(CurItem)
|
||||||
{
|
{
|
||||||
if(CurItem->MenuItem.wID == uSearchBy)
|
if(CurItem->wID == uSearchBy)
|
||||||
{
|
{
|
||||||
if(MenuItem) *MenuItem = CurItem;
|
if(MenuItem) *MenuItem = CurItem;
|
||||||
if(PrevMenuItem) *PrevMenuItem = PrevItem;
|
if(PrevMenuItem) *PrevMenuItem = PrevItem;
|
||||||
|
@ -462,64 +461,64 @@ W32kSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, LPCMENUITEMINF
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((MenuItem->MenuItem.fMask & (MIIM_TYPE | MIIM_STRING)) &&
|
/*if((MenuItem->fMask & (MIIM_TYPE | MIIM_STRING)) &&
|
||||||
(MENU_ITEM_TYPE(MenuItem->MenuItem.fType) == MF_STRING) &&
|
(MENU_ITEM_TYPE(MenuItem->fType) == MF_STRING) &&
|
||||||
MenuItem->MenuItem.dwTypeData)
|
MenuItem->dwTypeData)
|
||||||
{
|
{
|
||||||
/* delete old string */
|
// delete old string
|
||||||
ExFreePool(MenuItem->MenuItem.dwTypeData);
|
ExFreePool(MenuItem->dwTypeData);
|
||||||
MenuItem->MenuItem.dwTypeData = 0;
|
MenuItem->dwTypeData = 0;
|
||||||
MenuItem->MenuItem.cch = 0;
|
MenuItem->cch = 0;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
MenuItem->MenuItem.fType = lpmii->fType;
|
MenuItem->fType = lpmii->fType;
|
||||||
MenuItem->MenuItem.cch = lpmii->cch;
|
MenuItem->cch = lpmii->cch;
|
||||||
|
|
||||||
if(lpmii->fMask & MIIM_BITMAP)
|
if(lpmii->fMask & MIIM_BITMAP)
|
||||||
{
|
{
|
||||||
MenuItem->MenuItem.hbmpItem = lpmii->hbmpItem;
|
MenuItem->hbmpItem = lpmii->hbmpItem;
|
||||||
}
|
}
|
||||||
if(lpmii->fMask & MIIM_CHECKMARKS)
|
if(lpmii->fMask & MIIM_CHECKMARKS)
|
||||||
{
|
{
|
||||||
MenuItem->MenuItem.hbmpChecked = lpmii->hbmpChecked;
|
MenuItem->hbmpChecked = lpmii->hbmpChecked;
|
||||||
MenuItem->MenuItem.hbmpUnchecked = lpmii->hbmpUnchecked;
|
MenuItem->hbmpUnchecked = lpmii->hbmpUnchecked;
|
||||||
}
|
}
|
||||||
if(lpmii->fMask & MIIM_DATA)
|
if(lpmii->fMask & MIIM_DATA)
|
||||||
{
|
{
|
||||||
MenuItem->MenuItem.dwItemData = lpmii->dwItemData;
|
MenuItem->dwItemData = lpmii->dwItemData;
|
||||||
}
|
}
|
||||||
if(lpmii->fMask & (MIIM_FTYPE | MIIM_TYPE))
|
if(lpmii->fMask & (MIIM_FTYPE | MIIM_TYPE))
|
||||||
{
|
{
|
||||||
MenuItem->MenuItem.fType = lpmii->fType;
|
MenuItem->fType = lpmii->fType;
|
||||||
}
|
}
|
||||||
if(lpmii->fMask & MIIM_ID)
|
if(lpmii->fMask & MIIM_ID)
|
||||||
{
|
{
|
||||||
MenuItem->MenuItem.wID = lpmii->wID;
|
MenuItem->wID = lpmii->wID;
|
||||||
}
|
}
|
||||||
if(lpmii->fMask & MIIM_STATE)
|
if(lpmii->fMask & MIIM_STATE)
|
||||||
{
|
{
|
||||||
UpdateMenuItemState(MenuItem->MenuItem.fState, lpmii->fState);
|
UpdateMenuItemState(MenuItem->fState, lpmii->fState);
|
||||||
/* FIXME - only one item can have MFS_DEFAULT */
|
/* FIXME - only one item can have MFS_DEFAULT */
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lpmii->fMask & MIIM_SUBMENU)
|
if(lpmii->fMask & MIIM_SUBMENU)
|
||||||
{
|
{
|
||||||
MenuItem->MenuItem.hSubMenu = lpmii->hSubMenu;
|
MenuItem->hSubMenu = lpmii->hSubMenu;
|
||||||
}
|
}
|
||||||
if((lpmii->fMask & (MIIM_TYPE | MIIM_STRING)) &&
|
if((lpmii->fMask & (MIIM_TYPE | MIIM_STRING)) &&
|
||||||
(MENU_ITEM_TYPE(lpmii->fType) == MF_STRING) && lpmii->dwTypeData)
|
(MENU_ITEM_TYPE(lpmii->fType) == MF_STRING) && lpmii->dwTypeData)
|
||||||
{
|
{
|
||||||
FreeMenuText(MenuItem->MenuItem);
|
FreeMenuText(MenuItem);
|
||||||
MenuItem->MenuItem.dwTypeData = (LPWSTR)ExAllocatePool(PagedPool, (lpmii->cch + 1) * sizeof(WCHAR));
|
MenuItem->dwTypeData = (LPWSTR)ExAllocatePool(PagedPool, (lpmii->cch + 1) * sizeof(WCHAR));
|
||||||
if(!MenuItem->MenuItem.dwTypeData)
|
if(!MenuItem->dwTypeData)
|
||||||
{
|
{
|
||||||
MenuItem->MenuItem.cch = 0;
|
MenuItem->cch = 0;
|
||||||
/* FIXME Set last error code? */
|
/* FIXME Set last error code? */
|
||||||
SetLastWin32Error(STATUS_NO_MEMORY);
|
SetLastWin32Error(STATUS_NO_MEMORY);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
MenuItem->MenuItem.cch = lpmii->cch;
|
MenuItem->cch = lpmii->cch;
|
||||||
memcpy(MenuItem->MenuItem.dwTypeData, lpmii->dwTypeData, (lpmii->cch + 1) * sizeof(WCHAR));
|
memcpy(MenuItem->dwTypeData, lpmii->dwTypeData, (lpmii->cch + 1) * sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -559,8 +558,15 @@ W32kInsertMenuItem(PMENU_OBJECT MenuObject, UINT uItem, WINBOOL fByPosition,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlZeroMemory(&MenuItem->MenuItem, sizeof(MENUITEMINFOW));
|
MenuItem->fType = MFT_STRING;
|
||||||
MenuItem->MenuItem.cbSize = sizeof(MENUITEMINFOW);
|
MenuItem->fState = MFS_ENABLED | MFS_UNCHECKED;
|
||||||
|
MenuItem->wID = 0;
|
||||||
|
MenuItem->hSubMenu = (HMENU)0;
|
||||||
|
MenuItem->hbmpChecked = (HBITMAP)0;
|
||||||
|
MenuItem->hbmpUnchecked = (HBITMAP)0;
|
||||||
|
MenuItem->dwItemData = (ULONG_PTR)NULL;
|
||||||
|
MenuItem->cch = 0;
|
||||||
|
MenuItem->hbmpItem = (HBITMAP)0;
|
||||||
|
|
||||||
if(!W32kSetMenuItemInfo(MenuObject, MenuItem, lpmii))
|
if(!W32kSetMenuItemInfo(MenuObject, MenuItem, lpmii))
|
||||||
{
|
{
|
||||||
|
@ -583,33 +589,33 @@ W32kEnableMenuItem(PMENU_OBJECT MenuObject, UINT uIDEnableItem, UINT uEnable)
|
||||||
return (UINT)-1;
|
return (UINT)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = MenuItem->MenuItem.fState & (MF_GRAYED | MF_DISABLED);
|
res = MenuItem->fState & (MF_GRAYED | MF_DISABLED);
|
||||||
|
|
||||||
if(uEnable & MF_DISABLED)
|
if(uEnable & MF_DISABLED)
|
||||||
{
|
{
|
||||||
if(!(MenuItem->MenuItem.fState & MF_DISABLED))
|
if(!(MenuItem->fState & MF_DISABLED))
|
||||||
MenuItem->MenuItem.fState |= MF_DISABLED;
|
MenuItem->fState |= MF_DISABLED;
|
||||||
if(uEnable & MF_GRAYED)
|
if(uEnable & MF_GRAYED)
|
||||||
{
|
{
|
||||||
if(!(MenuItem->MenuItem.fState & MF_GRAYED))
|
if(!(MenuItem->fState & MF_GRAYED))
|
||||||
MenuItem->MenuItem.fState |= MF_GRAYED;
|
MenuItem->fState |= MF_GRAYED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(uEnable & MF_GRAYED)
|
if(uEnable & MF_GRAYED)
|
||||||
{
|
{
|
||||||
if(!(MenuItem->MenuItem.fState & MF_GRAYED))
|
if(!(MenuItem->fState & MF_GRAYED))
|
||||||
MenuItem->MenuItem.fState |= MF_GRAYED;
|
MenuItem->fState |= MF_GRAYED;
|
||||||
if(!(MenuItem->MenuItem.fState & MF_DISABLED))
|
if(!(MenuItem->fState & MF_DISABLED))
|
||||||
MenuItem->MenuItem.fState |= MF_DISABLED;
|
MenuItem->fState |= MF_DISABLED;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(MenuItem->MenuItem.fState & MF_DISABLED)
|
if(MenuItem->fState & MF_DISABLED)
|
||||||
MenuItem->MenuItem.fState ^= MF_DISABLED;
|
MenuItem->fState ^= MF_DISABLED;
|
||||||
if(MenuItem->MenuItem.fState & MF_GRAYED)
|
if(MenuItem->fState & MF_GRAYED)
|
||||||
MenuItem->MenuItem.fState ^= MF_GRAYED;
|
MenuItem->fState ^= MF_GRAYED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -644,16 +650,16 @@ W32kCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = (DWORD)(MenuItem->MenuItem.fState & MF_CHECKED);
|
res = (DWORD)(MenuItem->fState & MF_CHECKED);
|
||||||
if(uCheck & MF_CHECKED)
|
if(uCheck & MF_CHECKED)
|
||||||
{
|
{
|
||||||
if(!(MenuItem->MenuItem.fState & MF_CHECKED))
|
if(!(MenuItem->fState & MF_CHECKED))
|
||||||
MenuItem->MenuItem.fState |= MF_CHECKED;
|
MenuItem->fState |= MF_CHECKED;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(MenuItem->MenuItem.fState & MF_CHECKED)
|
if(MenuItem->fState & MF_CHECKED)
|
||||||
MenuItem->MenuItem.fState ^= MF_CHECKED;
|
MenuItem->fState ^= MF_CHECKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (DWORD)res;
|
return (DWORD)res;
|
||||||
|
@ -672,13 +678,13 @@ W32kHiliteMenuItem(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject,
|
||||||
|
|
||||||
if(uHilite & MF_HILITE)
|
if(uHilite & MF_HILITE)
|
||||||
{
|
{
|
||||||
if(!(MenuItem->MenuItem.fState & MF_HILITE))
|
if(!(MenuItem->fState & MF_HILITE))
|
||||||
MenuItem->MenuItem.fState |= MF_HILITE;
|
MenuItem->fState |= MF_HILITE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(MenuItem->MenuItem.fState & MF_HILITE)
|
if(MenuItem->fState & MF_HILITE)
|
||||||
MenuItem->MenuItem.fState ^= MF_HILITE;
|
MenuItem->fState ^= MF_HILITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME - update the window's menu */
|
/* FIXME - update the window's menu */
|
||||||
|
@ -698,14 +704,14 @@ W32kSetMenuDefaultItem(PMENU_OBJECT MenuObject, UINT uItem, UINT fByPos)
|
||||||
{
|
{
|
||||||
if(pos == uItem)
|
if(pos == uItem)
|
||||||
{
|
{
|
||||||
if(!(MenuItem->MenuItem.fState & MFS_DEFAULT))
|
if(!(MenuItem->fState & MFS_DEFAULT))
|
||||||
MenuItem->MenuItem.fState |= MFS_DEFAULT;
|
MenuItem->fState |= MFS_DEFAULT;
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(MenuItem->MenuItem.fState & MFS_DEFAULT)
|
if(MenuItem->fState & MFS_DEFAULT)
|
||||||
MenuItem->MenuItem.fState ^= MFS_DEFAULT;
|
MenuItem->fState ^= MFS_DEFAULT;
|
||||||
}
|
}
|
||||||
pos++;
|
pos++;
|
||||||
MenuItem = MenuItem->Next;
|
MenuItem = MenuItem->Next;
|
||||||
|
@ -715,16 +721,16 @@ W32kSetMenuDefaultItem(PMENU_OBJECT MenuObject, UINT uItem, UINT fByPos)
|
||||||
{
|
{
|
||||||
while(MenuItem)
|
while(MenuItem)
|
||||||
{
|
{
|
||||||
if(!ret && (MenuItem->MenuItem.wID == uItem))
|
if(!ret && (MenuItem->wID == uItem))
|
||||||
{
|
{
|
||||||
if(!(MenuItem->MenuItem.fState & MFS_DEFAULT))
|
if(!(MenuItem->fState & MFS_DEFAULT))
|
||||||
MenuItem->MenuItem.fState |= MFS_DEFAULT;
|
MenuItem->fState |= MFS_DEFAULT;
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(MenuItem->MenuItem.fState & MFS_DEFAULT)
|
if(MenuItem->fState & MFS_DEFAULT)
|
||||||
MenuItem->MenuItem.fState ^= MFS_DEFAULT;
|
MenuItem->fState ^= MFS_DEFAULT;
|
||||||
}
|
}
|
||||||
MenuItem = MenuItem->Next;
|
MenuItem = MenuItem->Next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue