MenuBarXP.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #if !defined(AFX_MenuBarXP_H__C492FD05_285B_11D5_99BD_5254AB339987__INCLUDED_)
  2. #define AFX_MenuBarXP_H__C492FD05_285B_11D5_99BD_5254AB339987__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // MenuBarXP.h : header file
  7. //
  8. #include "ToolBarXP.h"
  9. #define MB_POPUPMENU WM_USER + 1101
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CMenuBarXP window
  12. class CMenuBarXP : public CToolBarXP
  13. {
  14. // Construction
  15. public:
  16. CMenuBarXP();
  17. // Attributes
  18. protected:
  19. CMenu* m_pMenu;
  20. int m_nItemCount;
  21. int m_nPressed;
  22. POINT m_ptMouse;
  23. BOOL m_bTrack;
  24. CImageList m_ilIcons;
  25. //override
  26. // Operations
  27. public:
  28. BOOL LoadMenu(CMenu *pMenu);
  29. void TrackPopup();
  30. BOOL OnMenuInput(MSG* pMsg);
  31. static LRESULT CALLBACK MenuInputFilter(int nCode, WPARAM wParam, LPARAM lParam);
  32. BOOL OpenMenu(UINT nChar);
  33. // Overrides
  34. // ClassWizard generated virtual function overrides
  35. //{{AFX_VIRTUAL(CMenuBarXP)
  36. //}}AFX_VIRTUAL
  37. // Implementation
  38. public:
  39. virtual ~CMenuBarXP();
  40. // Generated message map functions
  41. protected:
  42. //{{AFX_MSG(CMenuBarXP)
  43. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  44. afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  45. afx_msg LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
  46. afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
  47. //}}AFX_MSG
  48. afx_msg LRESULT OnPopupMenu(WPARAM wParam, LPARAM lParam);
  49. afx_msg void OnExitMenuLoop(BOOL bTrackPopupMenu);
  50. afx_msg void OnEnterMenuLoop(BOOL bTrackPopupMenu);
  51. DECLARE_MESSAGE_MAP()
  52. };
  53. /////////////////////////////////////////////////////////////////////////////
  54. //{{AFX_INSERT_LOCATION}}
  55. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  56. #endif // !defined(AFX_MenuBarXP_H__C492FD05_285B_11D5_99BD_5254AB339987__INCLUDED_)