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.

90 lines
3.2 KiB

  1. #ifndef _MENUSITE_H_
  2. #define _MENUSITE_H_
  3. //#define WANT_CBANDSITE_CLASS
  4. //#include "bandsite.h"
  5. #include "cwndproc.h"
  6. // MenuSite will never have more than one client.
  7. class CMenuSite : public IBandSite,
  8. public IDeskBarClient,
  9. public IOleCommandTarget,
  10. public IInputObject,
  11. public IInputObjectSite,
  12. public IWinEventHandler,
  13. public IServiceProvider,
  14. public CImpWndProc
  15. {
  16. public:
  17. // *** IUnknown ***
  18. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  19. virtual STDMETHODIMP_(ULONG) AddRef(void);
  20. virtual STDMETHODIMP_(ULONG) Release(void);
  21. // *** IOleCommandTarget methods ***
  22. virtual STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup,
  23. ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
  24. virtual STDMETHODIMP Exec(const GUID *pguidCmdGroup,
  25. DWORD nCmdID, DWORD nCmdexecopt,
  26. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  27. // *** IInputObjectSite methods ***
  28. virtual STDMETHODIMP OnFocusChangeIS(IUnknown *punk, BOOL fSetFocus);
  29. // *** IInputObject methods ***
  30. virtual STDMETHODIMP UIActivateIO(BOOL fActivate, LPMSG lpMsg);
  31. virtual STDMETHODIMP HasFocusIO();
  32. virtual STDMETHODIMP TranslateAcceleratorIO(LPMSG lpMsg);
  33. // *** IServiceProvider methods ***
  34. virtual STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, LPVOID* ppvObj);
  35. // *** IOleWindow methods ***
  36. virtual STDMETHODIMP GetWindow(HWND * lphwnd);
  37. virtual STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
  38. // *** IDeskBarClient methods ***
  39. virtual STDMETHODIMP SetDeskBarSite(IUnknown* punkSite);
  40. virtual STDMETHODIMP SetModeDBC(DWORD dwMode);
  41. virtual STDMETHODIMP UIActivateDBC(DWORD dwState);
  42. virtual STDMETHODIMP GetSize(DWORD dwWhich, LPRECT prc);
  43. // *** IWinEventHandler Methods ***
  44. virtual STDMETHODIMP OnWinEvent(HWND hwnd, UINT dwMsg, WPARAM wParam, LPARAM lParam, LRESULT* plres);
  45. virtual STDMETHODIMP IsWindowOwner(HWND hwnd);
  46. // *** IBandSite ***
  47. virtual STDMETHODIMP AddBand(IUnknown* punk);
  48. virtual STDMETHODIMP EnumBands(UINT uBand, DWORD* pdwBandID);
  49. virtual STDMETHODIMP QueryBand(DWORD dwBandID, IDeskBand** ppstb, DWORD* pdwState, LPWSTR pszName, int cchName);
  50. virtual STDMETHODIMP SetBandState(DWORD dwBandID, DWORD dwMask, DWORD dwState);
  51. virtual STDMETHODIMP RemoveBand(DWORD dwBandID);
  52. virtual STDMETHODIMP GetBandObject(DWORD dwBandID, REFIID riid, LPVOID *ppvObj);
  53. virtual STDMETHODIMP SetBandSiteInfo(const BANDSITEINFO * pbsinfo);
  54. virtual STDMETHODIMP GetBandSiteInfo(BANDSITEINFO * pbsinfo);
  55. CMenuSite();
  56. protected:
  57. virtual ~CMenuSite();
  58. virtual LRESULT v_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  59. void _CreateSite(HWND hwndParent);
  60. void _CacheSubActiveBand(IUnknown * punk);
  61. IUnknown* _punkSite;
  62. IUnknown* _punkSubActive;
  63. IDeskBand* _pdb;
  64. IWinEventHandler* _pweh;
  65. HWND _hwndChild;
  66. int _cRef;
  67. };
  68. #endif // _MENUSITE_H_