Leaked source code of windows server 2003
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.

121 lines
4.4 KiB

  1. #ifndef _menubar_h
  2. #define _menubar_h
  3. #ifdef __cplusplus
  4. #include "iface.h"
  5. #include "basebar.h"
  6. IMenuPopup* CreateMenuPopup(IMenuPopup *pmpParent, IShellFolder* psf, LPCITEMIDLIST pidl, BANDINFOSFB * pbi, BOOL bMenuBand);
  7. IMenuPopup* CreateMenuPopup2(IMenuPopup *pmpParent, IMenuBand* pmb, IShellFolder* psf, LPCITEMIDLIST pidl, BANDINFOSFB * pbi, BOOL bMenuBand);
  8. HRESULT FindBandInBandSite(IMenuPopup* pmpParent, IBandSite** ppbs, LPCITEMIDLIST pidl, REFIID riid, void** ppvOut);
  9. HRESULT ShowBandInBandSite(IUnknown* punkBS, IUnknown* punkDB);
  10. class CMenuDeskBar :
  11. public CBaseBar
  12. ,public IMenuPopup
  13. ,public IObjectWithSite
  14. ,public IBanneredBar
  15. ,public IInitializeObject
  16. {
  17. public:
  18. // *** IUnknown ***
  19. virtual STDMETHODIMP_(ULONG) AddRef(void) { return CBaseBar::AddRef(); };
  20. virtual STDMETHODIMP_(ULONG) Release(void){ return CBaseBar::Release(); };
  21. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  22. // *** IServiceProvider methods ***
  23. virtual STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, LPVOID* ppvObj);
  24. // *** IOleWindow methods ***
  25. virtual STDMETHODIMP GetWindow(HWND * lphwnd) { return CBaseBar::GetWindow(lphwnd); };
  26. virtual STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) { return CBaseBar::ContextSensitiveHelp(fEnterMode); };
  27. // *** IDeskBar methods ***
  28. STDMETHODIMP SetClient(IUnknown* punk) { return CBaseBar::SetClient(punk); };
  29. STDMETHODIMP GetClient(IUnknown** ppunkClient) { return CBaseBar::GetClient(ppunkClient); };
  30. STDMETHODIMP OnPosRectChangeDB (LPRECT prc) { return CBaseBar::OnPosRectChangeDB(prc); };
  31. // *** IInputObjectSite methods (override) ***
  32. virtual STDMETHODIMP OnFocusChangeIS(IUnknown *punk, BOOL fSetFocus);
  33. // *** IMenuPopup methods ***
  34. virtual STDMETHODIMP Popup(POINTL *ppt, RECTL *prcExclude, DWORD dwFlags);
  35. virtual STDMETHODIMP OnSelect(DWORD dwSelectType);
  36. virtual STDMETHODIMP SetSubMenu(IMenuPopup* pmp, BOOL fSet);
  37. // *** IObjectWithSite methods ***
  38. STDMETHODIMP SetSite(IUnknown * pUnkSite);
  39. STDMETHODIMP GetSite(REFIID riid, void ** ppvSite);
  40. // *** IOleCommandTarget methods ***
  41. virtual STDMETHODIMP Exec(const GUID *pguidCmdGroup,
  42. DWORD nCmdID, DWORD nCmdexecopt,
  43. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  44. // *** IBanneredBar methods ***
  45. virtual STDMETHODIMP SetIconSize(DWORD iIcon);
  46. virtual STDMETHODIMP GetIconSize(DWORD* piIcon)
  47. { ASSERT(piIcon); *piIcon = _iIconSize; return NOERROR;};
  48. virtual STDMETHODIMP SetBitmap(HBITMAP hBitmap);
  49. virtual STDMETHODIMP GetBitmap(HBITMAP* phBitmap)
  50. { ASSERT(phBitmap); *phBitmap = _hbmp; return NOERROR;};
  51. // *** IInitializeObject methods ***
  52. // This is for Backwards compatility with Start Menu.
  53. STDMETHODIMP Initialize() { return NOERROR; }
  54. CMenuDeskBar();
  55. protected:
  56. virtual LRESULT v_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  57. virtual void _OnCreate();
  58. virtual void _OnSize();
  59. virtual DWORD _GetExStyle();
  60. virtual DWORD _GetClassStyle();
  61. void _AllowMessageThrough(UINT uMsg, WPARAM wParam, LPARAM lParam);
  62. virtual void _GetPopupWindowPosition(RECT* rcDesired, RECT* rcExclude, RECT *prcResult, SIZE * psizeEdge, UINT uside);
  63. void _PopDown();
  64. BOOL _IsMyParent(HWND hwnd);
  65. IMenuPopup* _GetMenuBarParent(IUnknown* punk);
  66. UINT _GetSide() { return _uSide;};
  67. HRESULT _PositionWindow(POINTL *ppt, RECTL* prcExclude, DWORD dwFlags);
  68. LRESULT _DoPaint(HWND hwnd, HDC hdc, DWORD dwFlags);
  69. void _DoNCPaint(HWND hwnd, HDC hdc);
  70. void _SelectItem(BOOL bFirst);
  71. void AdjustForTheme();
  72. virtual ~CMenuDeskBar();
  73. POINT _pt;
  74. IMenuPopup* _pmpParent;
  75. IMenuPopup* _pmpChild;
  76. IUnknown* _punkSite;
  77. UINT _uSide;
  78. HBITMAP _hbmp;
  79. DWORD _iIconSize;
  80. SIZE _sizeBmp;
  81. COLORREF _rgb;
  82. BITBOOL _fActive: 1;
  83. RECT _rcExclude;
  84. BITBOOL _fExcludeRect: 1; // TRUE: _rcExclude contains valid
  85. BITBOOL _fExpanded: 1;
  86. BITBOOL _fFlatMenuMode: 1;
  87. BOOL _fNoBorder;
  88. friend HRESULT CMenuDeskBar_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  89. };
  90. HRESULT TrackShellMenu(HWND hwnd, LPRECT prc, IShellMenu* psm, DWORD dwFlags);
  91. #endif // __cplusplus
  92. #endif // _menubar_h