当鼠标划过菜单项时状态栏会出现相应的提示信息。
请问:
当鼠标划过菜单项时如何的到相应菜单项的id?

解决方案 »

  1.   

    响应WM_MENUSELECT消息
    afx_msg void OnMenuSelect( UINT nItemID, UINT nFlags HMENU hSysMenu );ParametersnItemIDIdentifies the item selected. If the selected item is a menu item, nItemID contains the menu-item ID. If the selected item contains a pop-up menu, nItemID contains the pop-up menu index, and hSysMenu contains the handle of the main (clicked-on) menu.nFlagsContains a combination of the following menu flags: MF_BITMAP   Item is a bitmap.
    MF_CHECKED   Item is checked.
    MF_DISABLED   Item is disabled.
    MF_GRAYED   Item is dimmed.
    MF_MOUSESELECT   Item was selected with a mouse.
    MF_OWNERDRAW   Item is an owner-draw item.
    MF_POPUP   Item contains a pop-up menu.
    MF_SEPARATOR   Item is a menu-item separator.
    MF_SYSMENU   Item is contained in the Control menu. 
    hSysMenuIf nFlags contains MF_SYSMENU, identifies the menu associated with the message. If nFlags contains MF_POPUP, identifies the handle of the main menu. If nFlags contains neither MF_SYSMENU nor MF_POPUP, it is unused.