直接的函数可能是没有的,你可参考以下的几个win32api,截获 WM_DRAWITEM 消息试试看<br><br>函数功能:该函数改动一个菜单项的信息。<br><br> 函数原型:BOOL SetMenultemlnfo(HMENU hMenu,UINT uitem,BOOL fByPosition,LPMENUITEMINFO lpmii);<br><br> 参数:<br><br> hMenu:包含菜单项的菜单的句柄。<br><br> ultem:将被修改的菜单项的标识符或位置。此参数的含义由参数fByPosition确定。<br><br> FByPosition:用于指定参数ultem的含义的值。如果此参数值为FALSE,则参数ultem<br>是菜单项的标识符,否则,表示菜单项的位置。<br><br> lpmii:指向结构MENUITEMINFO的指针。该结构含有菜单项的信息,并且.指定将被修<br>改的菜单项的属性。<br><br> 返回值:如果函数调用成功,返回非零值:如果函数调用失败,返回值是零。若想获得<br>更多的错误信息,请调用GetLastError函数。<br><br> 备注:为了使键盘加速键能控制位图或自己绘制的菜单项,菜单的拥有者必须处理<br>WM_MENUCHAR消息。参见自绘制菜单和WM_MENUCHAR消息。Windows CE环境下,只有下列值<br>对参数lpmii指向的MENUITEMINFO结构中的fMask成员有效:MIIM_DATA;MIIM_;MIIM_TYPE;<br>如果MIIM-TYPE被指定,结构MENUITEMINFO的fType成员必须为菜单项的当前类型,也就<br>是说,该类型不能被改变。<br><br>he MENUITEMINFO structure contains information about a menu item. <br><br>typedef struct tagMENUITEMINFO {<br> UINT cbSize; <br> UINT fMask; <br> UINT fType; <br> UINT fState; <br> UINT wID; <br> HMENU hSubMenu; <br> HBITMAP hbmpChecked; <br> HBITMAP hbmpUnchecked; <br> DWORD dwItemData; <br> LPTSTR dwTypeData; <br> UINT cch; <br>} MENUITEMINFO, FAR *LPMENUITEMINFO; <br> <br><br>Members<br><br>cbsize<br><br>Size of structure, in bytes.<br><br>fMask<br><br>Members to retrieve or set. This member can be one or more of these values:<br><br>Value Meaning<br>MIIM_CHECKMARKS Retrieves or sets the hbmpChecked and hbmpUnchecked members.<br>MIIM_DATA Retrieves or sets the dwItemData member.<br>MIIM_ID Retrieves or sets the wID member.<br>MIIM_STATE Retrieves or sets the fState member.<br>MIIM_SUBMENU Retrieves or sets the hSubMenu member.<br>MIIM_TYPE Retrieves or sets the fType and dwTypeData members.<br> <br><br>fType<br><br>Menu item type. This member can be one or more of these values:<br><br>Value Meaning<br>MFT_BITMAP Displays the menu item using a bitmap. The low-order word of the dwTypeData member is the bitmap handle, and the cch member is ignored.<br>MFT_MENUBARBREAK Places the menu item on a new line (for a menu bar) or in a new column (for a drop-down menu, submenu, or shortcut menu). For a drop-down menu, submenu, or shortcut menu, a vertical line separates the new column from the old.<br>MFT_MENUBREAK Places the menu item on a new line (for a menu bar) or in a new column (for a drop-down menu, submenu, or shortcut menu). For a drop-down menu, submenu, or shortcut menu, the columns are not separated by a vertical line.<br>MFT_OWNERDRAW Assigns responsibility for drawing the menu item to the window that owns the menu. The window receives a WM_MEASUREITEM message before the menu is displayed for the first time, and a WM_DRAWITEM message whenever the appearance of the menu item must be updated. If this value is specified, the dwTypeData member contains an application-defined 32-bit value.<br>MFT_RADIOCHECK Displays checked menu items using a radio-button mark instead of a check mark if the hbmpChecked member is NULL.<br>MFT_RIGHTJUSTIFY Right-justifies the menu item and any subsequent items. This value is valid only if the menu item is in a menu bar.<br>MFT_SEPARATOR Specifies that the menu item is a separator. A menu item separator appears as a horizontal dividing line. The dwTypeData and cch members are ignored. This value is valid only in a drop-down menu, submenu, or shortcut menu.<br>MFT_STRING Displays the menu item using a text string. The dwTypeData member is the pointer to a null-terminated string, and the cch member is the length of the string.<br> <br><br>The MFT_BITMAP, MFT_SEPARATOR, and MFT_STRING values cannot be combined with one another.<br><br>fState<br><br>Menu item state. This member can be one or more of these values:<br><br>Value Meaning<br>MFS_CHECKED Checks the menu item. For more information about checked menu items, see the hbmpChecked member.<br>MFS_DEFAULT Specifies that the menu item is the default. A menu can contain only one default menu item, which is displayed in bold.<br>MFS_DISABLED Disables the menu item so that it cannot be selected, but does not gray it.<br>MFS_ENABLED Enables the menu item so that it can be selected. This is the default state.<br>MFS_GRAYED Disables the menu item and grays it so that it cannot be selected.<br>MFS_HILITE Highlights the menu item.<br>MFS_UNCHECKED Unchecks the menu item. For more information about unchecked menu items, see the hbmpUnchecked member.<br>MFS_UNHILITE Removes the highlight from the menu item. This is the default state.<br> <br><br>wID<br><br>Application-defined 16-bit value that identifies the menu item.<br><br>hSubMenu<br><br>Handle to the drop-down menu or submenu associated with the menu item. If the menu item is not an item that opens a drop-down menu or submenu, this member is NULL.<br><br>hbmpChecked<br><br>Handle to the bitmap to display next to the item if it is checked. If this member is NULL, a default bitmap is used. If the MFT_RADIOCHECK type value is specified, the default bitmap is a bullet. Otherwise, it is a check mark.<br><br>hbmpUnchecked<br><br>Handle to the bitmap to display next to the item if it is not checked. If this member is NULL, no bitmap is used.<br><br>dwItemData<br><br>Application-defined value associated with the menu item.<br><br>dwTypeData<br><br>Content of the menu item. The meaning of this member depends on the menu item type: the MFT_BITMAP, MFT_SEPARATOR, or MFT_STRING values.<br><br>cch<br><br>Length of the menu item text, when information is received about a menu item of the MFT_STRING type. This value is zero for other menu item types. This member is ignored when the content of a menu item is set.<br><br> <br><br>Remarks<br><br>The MENUITEMINFO structure is used with the GetMenuItemInfo, InsertMenuItem, and SetMenuItemInfo functions.