Difference between revisions of "Techwiki:Win32k/MENU"

From ReactOS Wiki
Jump to: navigation, search
 
Line 3: Line 3:
 
  typedef struct _ITEM
 
  typedef struct _ITEM
 
  {
 
  {
  /* 000 */ UINT   fType;
+
  /* 000 */ UINT         fType;
  /* 004 */ UINT   fState;
+
  /* 004 */ UINT         fState;
  /* 008 */ UINT   wID;
+
  /* 008 */ UINT         wID;
 
  /* 00c */ struct _MENU *spSubMenu;
 
  /* 00c */ struct _MENU *spSubMenu;
  /* 010 */ HBITMAP hbmpChecked;
+
  /* 010 */ HBITMAP       hbmpChecked;
  /* 014 */ HBITMAP hbmpUnchecked;
+
  /* 014 */ HBITMAP       hbmpUnchecked;
  /* 018 */ LPWSTR lpstr;
+
  /* 018 */ LPWSTR       lpstr;
  /* 01c */ UINT   cch;
+
  /* 01c */ UINT         cch;
  /* 020 */ ULONG_PTR dwItemData;
+
  /* 020 */ ULONG_PTR     dwItemData;
  /* 024 */ DWORD   xItem;
+
  /* 024 */ DWORD         xItem;
  /* 028 */ DWORD   yItem;
+
  /* 028 */ DWORD         yItem;
  /* 02c */ DWORD   cxItem;
+
  /* 02c */ DWORD         cxItem;
  /* 030 */ DWORD   cyItem;
+
  /* 030 */ DWORD         cyItem;
  /* 034 */ DWORD   dxTab;
+
  /* 034 */ DWORD         dxTab;
  /* 038 */ DWORD   ulX;
+
  /* 038 */ DWORD         ulX;
  /* 03c */ DWORD   ulWidth;
+
  /* 03c */ DWORD         ulWidth;
  /* 040 */ HBITMAP hbmp;
+
  /* 040 */ HBITMAP       hbmp;
  /* 044 */ DWORD   cxBmp;
+
  /* 044 */ DWORD         cxBmp;
  /* 048 */ DWORD   cyBmp;
+
  /* 048 */ DWORD         cyBmp;
 
  } ITEM, *PITEM;
 
  } ITEM, *PITEM;
 
   
 
   
 
  /* Menu Item fType. */
 
  /* Menu Item fType. */
  #define MFT_RTOL 0x6000
+
  #define MFT_RTOL       0x6000
 
   
 
   
 
  typedef struct tagMENULIST
 
  typedef struct tagMENULIST
 
  {
 
  {
     struct tagMENULIST* pNext;
+
     struct tagMENULIST* pNext;
     struct tagMENU*     pMenu;
+
     struct tagMENU*     pMenu;
 
  } MENULIST, *PMENULIST;
 
  } MENULIST, *PMENULIST;
 
   
 
   
Line 45: Line 45:
 
  {
 
  {
 
  /* 000 */ [[Techwiki:win32k/HEAD|PROCDESKHEAD]]  head;
 
  /* 000 */ [[Techwiki:win32k/HEAD|PROCDESKHEAD]]  head;
  /* 014 */ ULONG     fFlags;  // See menuinfo dwStyle.
+
  /* 014 */ ULONG         fFlags;  // See menuinfo dwStyle.
  /* 018 */ INT       iItem;
+
  /* 018 */ INT           iItem;
  /* 01c */ DWORD     cAlloced;
+
  /* 01c */ DWORD         cAlloced;
  /* 020 */ DWORD     cItems;
+
  /* 020 */ DWORD         cItems;
  /* 024 */ DWORD     cxMenu;
+
  /* 024 */ DWORD         cxMenu;
  /* 028 */ DWORD     cyMenu;
+
  /* 028 */ DWORD         cyMenu;
  /* 02c */ DWORD     cxTextAlign;
+
  /* 02c */ DWORD         cxTextAlign;
  /* 030 */ PWND     spwndNotify;
+
  /* 030 */ PWND         spwndNotify;
  /* 034 */ PITEM     rgItems;
+
  /* 034 */ PITEM         rgItems;
  /* 038 */ PMENULIST pParentMenus; // See Note 1.
+
  /* 038 */ PMENULIST     pParentMenus; // See Note 1.
  /* 03c */ DWORD     dwContextHelpId;
+
  /* 03c */ DWORD         dwContextHelpId;
  /* 040 */ UINT     cyMax;
+
  /* 040 */ UINT         cyMax;
  /* 044 */ ULONG_PTR dwMenuData;
+
  /* 044 */ ULONG_PTR     dwMenuData;
  /* 048 */ HBRUSH   hbrBack;
+
  /* 048 */ HBRUSH       hbrBack;
  /* 04c */ INT       iTop;
+
  /* 04c */ INT           iTop;
  /* 050 */ INT       iMaxTop;
+
  /* 050 */ INT           iMaxTop;
  /* 054 */ DWORD     dwArrowsOn:2; //Arrows: 0 off, 1 on, 2 to the top, 3 to the bottom.
+
  /* 054 */ DWORD         dwArrowsOn:2; //Arrows: 0 off, 1 on, 2 to the top, 3 to the bottom.
 
  } MENU, *PMENU;
 
  } MENU, *PMENU;
  

Latest revision as of 08:58, 10 November 2010

Windows XP version of ITEM and MENU

typedef struct _ITEM
{
/* 000 */ UINT          fType;
/* 004 */ UINT          fState;
/* 008 */ UINT          wID;
/* 00c */ struct _MENU *spSubMenu;
/* 010 */ HBITMAP       hbmpChecked;
/* 014 */ HBITMAP       hbmpUnchecked;
/* 018 */ LPWSTR        lpstr;
/* 01c */ UINT          cch;
/* 020 */ ULONG_PTR     dwItemData;
/* 024 */ DWORD         xItem;
/* 028 */ DWORD         yItem;
/* 02c */ DWORD         cxItem;
/* 030 */ DWORD         cyItem;
/* 034 */ DWORD         dxTab;
/* 038 */ DWORD         ulX;
/* 03c */ DWORD         ulWidth;
/* 040 */ HBITMAP       hbmp;
/* 044 */ DWORD         cxBmp;
/* 048 */ DWORD         cyBmp;
} ITEM, *PITEM;

/* Menu Item fType. */
#define MFT_RTOL        0x6000

typedef struct tagMENULIST
{
   struct tagMENULIST*  pNext;
   struct tagMENU*      pMenu;
} MENULIST, *PMENULIST;

// Menu fFlags, upper byte is MNS_X style flags.
#define MNF_POPUP       0x0001 // CreatePopupMenu->InternalCreateMenu(true);
#define MNF_UNDERLINE   0x0004 // if not underlined is ODS_NOACCEL, menustate.fUnderline
#define MNF_INACTIVE    0x0010 // Associated with ODS_INACTIVE
#define MNF_RTOL        0x0020
#define MNF_DESKTOPMN   0x0040 // LockDesktopMenu
#define MNF_SYSDESKMN   0x0080 // xxxLoadSysDesktopMenu
#define MNF_SYSSUBMENU  0x0100 // xxxGetSystemMenu for GetSubMenu

typedef struc _MENU
{
/* 000 */ PROCDESKHEAD  head;
/* 014 */ ULONG         fFlags;  // See menuinfo dwStyle.
/* 018 */ INT           iItem;
/* 01c */ DWORD         cAlloced;
/* 020 */ DWORD         cItems;
/* 024 */ DWORD         cxMenu;
/* 028 */ DWORD         cyMenu;
/* 02c */ DWORD         cxTextAlign;
/* 030 */ PWND          spwndNotify;
/* 034 */ PITEM         rgItems;
/* 038 */ PMENULIST     pParentMenus; // See Note 1.
/* 03c */ DWORD         dwContextHelpId;
/* 040 */ UINT          cyMax;
/* 044 */ ULONG_PTR     dwMenuData;
/* 048 */ HBRUSH        hbrBack;
/* 04c */ INT           iTop;
/* 050 */ INT           iMaxTop;
/* 054 */ DWORD         dwArrowsOn:2; //Arrows: 0 off, 1 on, 2 to the top, 3 to the bottom.
} MENU, *PMENU;

NOTE:

1. Pointer to a linked list of parent menu pointers. Allocated by DesktopAlloc with a size of 8 in xxxSetLPITEMInfo.

References

  • msdn MENUINFO
  • msdn MENUITEMINFO
  • "Undocumented Windows, A Programmer's Guide to Reserved MS Win API Functions", page 473 - 477.
  • Windows Symbol files, userkdx.dll, !dso, w7u