Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.7 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // MMENU.H: Declares custom menu interface for multimedia applet
  4. //
  5. // Copyright (c) Microsoft Corporation 1998
  6. //
  7. // 1/28/98 David Stewart / dstewart
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  10. #ifndef _MMENUHEADER_
  11. #define _MMENUHEADER_
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. BOOL IsBiDiLocalizedSystem( LANGID *pLangID );
  16. class CustomMenu;
  17. class CCustomMenu;
  18. class CustomMenu
  19. {
  20. public:
  21. //append a string value
  22. virtual BOOL AppendMenu(int nMenuID, TCHAR* szMenu) = 0;
  23. //append a string from your resources
  24. virtual BOOL AppendMenu(int nMenuID, HINSTANCE hInst, int nStringID) = 0;
  25. //append a string and an icon from your resources
  26. virtual BOOL AppendMenu(int nMenuID, HINSTANCE hInst, int nIconID, int nStringID) = 0;
  27. //append another custom menu, with a resource string
  28. virtual BOOL AppendMenu(HINSTANCE hInst, int nStringID, CustomMenu* pMenu) = 0;
  29. virtual BOOL AppendSeparator() = 0;
  30. virtual BOOL TrackPopupMenu(UINT uFlags, int x, int y, HWND hwnd, CONST RECT* pRect) = 0;
  31. virtual BOOL SetMenuDefaultItem(UINT uItem, UINT fByPos) = 0;
  32. virtual void MeasureItem(HWND hwnd, LPMEASUREITEMSTRUCT pMeasure) = 0;
  33. virtual void DrawItem(HWND hwnd, LPDRAWITEMSTRUCT pDraw) = 0;
  34. virtual LRESULT MenuChar(TCHAR tChar, UINT fuFlag, HMENU hMenu) = 0;
  35. virtual HMENU GetMenuHandle() = 0;
  36. virtual void Destroy() = 0;
  37. };
  38. class CCustomMenu : CustomMenu
  39. {
  40. public:
  41. friend HRESULT AllocCustomMenu(CustomMenu** ppMenu);
  42. CCustomMenu();
  43. BOOL AppendMenu(int nMenuID, TCHAR* szMenu);
  44. BOOL AppendMenu(int nMenuID, HINSTANCE hInst, int nStringID);
  45. BOOL AppendMenu(int nMenuID, HINSTANCE hInst, int nIconID, int nStringID);
  46. BOOL AppendMenu(HINSTANCE hInst, int nStringID, CustomMenu* pMenu);
  47. BOOL AppendSeparator();
  48. BOOL TrackPopupMenu(UINT uFlags, int x, int y, HWND hwnd, CONST RECT* pRect);
  49. BOOL SetMenuDefaultItem(UINT uItem, UINT fByPos);
  50. void MeasureItem(HWND hwnd, LPMEASUREITEMSTRUCT pMeasure);
  51. void DrawItem(HWND hwnd, LPDRAWITEMSTRUCT pDraw);
  52. LRESULT MenuChar(TCHAR tChar, UINT fuFlag, HMENU hMenu);
  53. HMENU GetMenuHandle() {return m_hMenu;}
  54. void Destroy();
  55. protected:
  56. ~CCustomMenu();
  57. BOOL IsItemFirst(int nMenuID);
  58. BOOL IsItemLast(int nMenuID);
  59. private:
  60. HMENU m_hMenu;
  61. HFONT m_hFont;
  62. HFONT m_hBoldFont;
  63. BOOL m_bRTLMenu;
  64. };
  65. #ifdef __cplusplus
  66. };
  67. #endif //c++
  68. #endif //_MMENUHEADER_