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.

98 lines
3.6 KiB

  1. #ifndef BaseBar_H_
  2. #define BaseBar_H_
  3. #include "cwndproc.h"
  4. #ifdef __cplusplus
  5. //========================================================================
  6. // class CBaseBar (CBaseBar* pwbar)
  7. //========================================================================
  8. class CBaseBar : public IOleCommandTarget
  9. , public IServiceProvider
  10. , public IDeskBar
  11. ,public IInputObjectSite
  12. ,public IInputObject
  13. , public CImpWndProc
  14. {
  15. public:
  16. // *** IUnknown ***
  17. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  18. virtual STDMETHODIMP_(ULONG) AddRef(void) ;
  19. virtual STDMETHODIMP_(ULONG) Release(void);
  20. // *** IOleCommandTarget methods ***
  21. virtual STDMETHODIMP QueryStatus(const GUID *pguidCmdGroup,
  22. ULONG cCmds, OLECMD rgCmds[], OLECMDTEXT *pcmdtext);
  23. virtual STDMETHODIMP Exec(const GUID *pguidCmdGroup,
  24. DWORD nCmdID, DWORD nCmdexecopt,
  25. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut);
  26. // *** IServiceProvider methods ***
  27. virtual STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, LPVOID* ppvObj);
  28. // *** IOleWindow methods ***
  29. virtual STDMETHODIMP GetWindow(HWND * lphwnd);
  30. virtual STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
  31. // *** IDeskBar methods ***
  32. virtual STDMETHODIMP SetClient(IUnknown* punk);
  33. virtual STDMETHODIMP GetClient(IUnknown** ppunkClient);
  34. virtual STDMETHODIMP OnPosRectChangeDB (LPRECT prc);
  35. // *** IInputObjectSite methods ***
  36. virtual STDMETHODIMP OnFocusChangeIS(IUnknown *punk, BOOL fSetFocus);
  37. // *** IInputObject methods ***
  38. virtual STDMETHODIMP UIActivateIO(BOOL fActivate, LPMSG lpMsg);
  39. virtual STDMETHODIMP HasFocusIO();
  40. virtual STDMETHODIMP TranslateAcceleratorIO(LPMSG lpMsg);
  41. protected:
  42. // Constructor & Destructor
  43. CBaseBar();
  44. virtual ~CBaseBar();
  45. BOOL _CheckForwardWinEvent(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plres);
  46. virtual void _NotifyModeChange(DWORD dwMode); // NOTE: we may be abhe to get rid of this virtual...
  47. void _GetBorderRect(RECT* prc);
  48. virtual STDMETHODIMP ShowDW(BOOL fShow); // match IDockingWindow::ShowDW
  49. virtual STDMETHODIMP CloseDW(DWORD dwReserved); // match IDockingWindow::CloseDW
  50. virtual LRESULT _OnCommand(UINT msg, WPARAM wparam, LPARAM lparam);
  51. virtual LRESULT _OnNotify(UINT msg, WPARAM wparam, LPARAM lparam);
  52. virtual void _OnSize(void);
  53. virtual void _OnCreate();
  54. virtual void _OnPostedPosRectChange();
  55. virtual DWORD _GetExStyle();
  56. virtual DWORD _GetClassStyle();
  57. // Window procedure
  58. virtual LRESULT v_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  59. // Member variables
  60. UINT _cRef; // reference count
  61. IUnknown* _punkChild; // ptr to IUnknown for client area
  62. IDeskBarClient* _pDBC; // cached BaseBarClient for _punkChild
  63. IWinEventHandler* _pWEH; // cached IWenEventHandler for _punkChild
  64. HWND _hwndChild; // cached HWND for _punkChild
  65. HWND _hwndSite; // hwnd of the site
  66. BOOL _fShow :1;
  67. BOOL _fPosRectChangePending;
  68. DWORD _dwMode;
  69. SIZE _szChild; // last requested size from child
  70. private:
  71. // Private members
  72. void _RegisterDeskBarClass();
  73. void _CreateDeskBarWindow();
  74. };
  75. #endif // __cplusplus
  76. #endif