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.

131 lines
4.5 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation
  3. Module Name:
  4. ctvctl.h
  5. Abstract:
  6. header file for ctvctl.cpp
  7. Author:
  8. William Hsieh (williamh) created
  9. Revision History:
  10. --*/
  11. #include "..\inc\tvintf.h"
  12. // CTVCtl.h : Declaration of the CTVCtrl OLE control class.
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CTVCtrl : See CTVCtl.cpp for implementation.
  15. class CTVCtrl : public COleControl
  16. {
  17. DECLARE_DYNCREATE(CTVCtrl)
  18. // Constructor
  19. public:
  20. CTVCtrl();
  21. // Overrides
  22. // ClassWizard generated virtual function overrides
  23. //{{AFX_VIRTUAL(CTVCtrl)
  24. public:
  25. virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  26. virtual void DoPropExchange(CPropExchange* pPX);
  27. virtual void OnResetState();
  28. virtual BOOL PreTranslateMessage(MSG* pMsg);
  29. //}}AFX_VIRTUAL
  30. // Implementation
  31. protected:
  32. ~CTVCtrl();
  33. DECLARE_OLECREATE_EX(CTVCtrl) // Class factory and guid
  34. DECLARE_OLETYPELIB(CTVCtrl) // GetTypeInfo
  35. DECLARE_OLECTLTYPE(CTVCtrl) // Type name and misc status
  36. // Subclassed control support
  37. BOOL PreCreateWindow(CREATESTRUCT& cs);
  38. BOOL IsSubclassedControl();
  39. LRESULT OnOcmCommand(WPARAM wParam, LPARAM lParam);
  40. // Message maps
  41. //{{AFX_MSG(CTVCtrl)
  42. afx_msg void OnDestroy();
  43. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  44. //}}AFX_MSG
  45. afx_msg LRESULT OnOcmNotify(WPARAM wParam, LPARAM lParam);
  46. DECLARE_MESSAGE_MAP()
  47. // Dispatch maps
  48. //{{AFX_DISPATCH(CTVCtrl)
  49. //}}AFX_DISPATCH
  50. DECLARE_DISPATCH_MAP()
  51. // Event maps
  52. //{{AFX_EVENT(CTVCtrl)
  53. //}}AFX_EVENT
  54. DECLARE_EVENT_MAP()
  55. protected:
  56. DECLARE_INTERFACE_MAP()
  57. BEGIN_INTERFACE_PART(DMTVOCX, IDMTVOCX)
  58. public: virtual HTREEITEM InsertItem(LPTV_INSERTSTRUCT pis);
  59. public: virtual HRESULT DeleteItem(HTREEITEM hItem);
  60. public: virtual HRESULT DeleteAllItems();
  61. public: virtual HIMAGELIST SetImageList(INT iImage, HIMAGELIST himl);
  62. public: virtual HRESULT SetItem(TV_ITEM* pitem);
  63. public: virtual HRESULT Expand(UINT Flags, HTREEITEM htiem);
  64. public: virtual HRESULT SelectItem(UINT Flags, HTREEITEM hitem);
  65. public: virtual HRESULT SetStyle(DWORD dwStyle);
  66. public: virtual HWND GetWindowHandle();
  67. public: virtual HRESULT GetItem(TV_ITEM* pti);
  68. public: virtual HTREEITEM GetNextItem(UINT Flags, HTREEITEM htiRef);
  69. public: virtual HRESULT SelectItem(HTREEITEM hti);
  70. public: virtual UINT GetCount();
  71. public: virtual HTREEITEM GetSelectedItem();
  72. public: virtual HRESULT Connect(IComponent* pIComponent, MMC_COOKIE);
  73. public: virtual HRESULT SetActiveConnection(MMC_COOKIE cookie);
  74. public: virtual MMC_COOKIE GetActiveConnection();
  75. public: virtual HRESULT SetRedraw(BOOL Redraw);
  76. public: virtual BOOL EnsureVisible(HTREEITEM hitem);
  77. END_INTERFACE_PART(DMTVOCX)
  78. private:
  79. HTREEITEM InsertItem(LPTV_INSERTSTRUCT pis);
  80. HRESULT DeleteItem(HTREEITEM hItem);
  81. HRESULT DeleteAllItems();
  82. HIMAGELIST SetImageList(INT iImage, HIMAGELIST himl);
  83. HRESULT SetItem(TV_ITEM* pitem);
  84. HRESULT Expand(UINT Flags, HTREEITEM htiem);
  85. HRESULT SelectItem(UINT Flags, HTREEITEM hitem);
  86. HRESULT SetStyle(DWORD dwStyle);
  87. HWND GetWindowHandle();
  88. HRESULT GetItem(TV_ITEM* pti);
  89. HTREEITEM GetNextItem(UINT Flags, HTREEITEM htiRef);
  90. HRESULT SelectItem(HTREEITEM hti);
  91. UINT GetCount();
  92. HTREEITEM HitTest(LONG x, LONG y, UINT* phtFlags);
  93. HTREEITEM GetSelectedItem();
  94. HRESULT Connect(IComponent* pIComponent, MMC_COOKIE cookie);
  95. HRESULT SetActiveConnection(MMC_COOKIE cookie);
  96. MMC_COOKIE GetActiveConnection();
  97. HRESULT SetRedraw(BOOL Redraw);
  98. BOOL EnsureVisible(HTREEITEM hitem);
  99. TV_NOTIFY_CODE DoMouseNotification(UINT code, MMC_COOKIE* pcookie,LPARAM* parg, LPARAM* param);
  100. // private data
  101. MMC_COOKIE m_ActiveCookie;
  102. int m_nConnections;
  103. BOOL m_HasFocus;
  104. IComponent* m_pIComponent;
  105. ISnapinCallback* m_pISnapinCallback;
  106. BOOL m_Destroyed;
  107. };