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.

151 lines
4.8 KiB

  1. #ifndef __CONTROL_FOLDER__
  2. #define __CONTROL_FOLDER__
  3. #include "general.h"
  4. // forward declaration
  5. class CControlFolder;
  6. class CControlItem;
  7. HRESULT CControlFolderEnum_CreateInstance(
  8. LPITEMIDLIST pidl,
  9. UINT shcontf,
  10. LPENUMIDLIST *ppeidl);
  11. HRESULT CControlItem_CreateInstance(
  12. CControlFolder *pCFolder,
  13. UINT cidl,
  14. LPCITEMIDLIST *ppidl,
  15. REFIID riid,
  16. void **ppvOut);
  17. HRESULT ControlFolderView_Command(HWND hwnd, UINT uID);
  18. UINT MergeMenuHierarchy(
  19. HMENU hmenuDst,
  20. HMENU hmenuSrc,
  21. UINT idcMin,
  22. UINT idcMax);
  23. ///////////////////////////////////////////////////////////////////////////////
  24. // CControlFolder declaration
  25. class CControlFolder : public IShellFolder,
  26. public IPersistFolder2,
  27. public IContextMenu
  28. {
  29. // CControlFolder interfaces
  30. friend CControlItem;
  31. friend HRESULT ControlFolderView_CreateInstance(CControlFolder *pHCFolder, LPCITEMIDLIST pidl, void **ppvOut);
  32. friend HRESULT ControlFolderView_DidDragDrop(
  33. HWND hwnd,
  34. IDataObject *pdo,
  35. DWORD dwEffect);
  36. public:
  37. CControlFolder();
  38. // IUnknown Methods
  39. STDMETHODIMP QueryInterface(REFIID,void **);
  40. STDMETHODIMP_(ULONG) AddRef(void);
  41. STDMETHODIMP_(ULONG) Release(void);
  42. // IShellFolder methods
  43. STDMETHODIMP ParseDisplayName(
  44. HWND hwndOwner,
  45. LPBC pbcReserved,
  46. LPOLESTR lpszDisplayName,
  47. ULONG *pchEaten,
  48. LPITEMIDLIST *ppidl,
  49. ULONG *pdwAttributes);
  50. STDMETHODIMP EnumObjects(
  51. HWND hwndOwner,
  52. DWORD grfFlags,
  53. LPENUMIDLIST *ppenumIDList);
  54. STDMETHODIMP BindToObject(
  55. LPCITEMIDLIST pidl,
  56. LPBC pbcReserved,
  57. REFIID riid,
  58. void **ppvOut);
  59. STDMETHODIMP BindToStorage(
  60. LPCITEMIDLIST pidl,
  61. LPBC pbcReserved,
  62. REFIID riid,
  63. void **ppvObj);
  64. STDMETHODIMP CompareIDs(
  65. LPARAM lParam,
  66. LPCITEMIDLIST pidl1,
  67. LPCITEMIDLIST pidl2);
  68. STDMETHODIMP CreateViewObject(
  69. HWND hwndOwner,
  70. REFIID riid,
  71. void **ppvOut);
  72. STDMETHODIMP GetAttributesOf(
  73. UINT cidl,
  74. LPCITEMIDLIST *apidl,
  75. ULONG *rgfInOut);
  76. STDMETHODIMP GetUIObjectOf(
  77. HWND hwndOwner,
  78. UINT cidl,
  79. LPCITEMIDLIST *apidl,
  80. REFIID riid,
  81. UINT *prgfInOut,
  82. void **ppvOut);
  83. STDMETHODIMP GetDisplayNameOf(
  84. LPCITEMIDLIST pidl,
  85. DWORD uFlags,
  86. LPSTRRET lpName);
  87. STDMETHODIMP SetNameOf(
  88. HWND hwndOwner,
  89. LPCITEMIDLIST pidl,
  90. LPCOLESTR lpszName,
  91. DWORD uFlags,
  92. LPITEMIDLIST *ppidlOut);
  93. // IShellIcon Methods
  94. STDMETHODIMP GetIconOf(LPCITEMIDLIST pidl, UINT flags, LPINT lpIconIndex);
  95. // IPersist Methods
  96. STDMETHODIMP GetClassID(LPCLSID lpClassID);
  97. // IPersistFolder Methods
  98. STDMETHODIMP Initialize(LPCITEMIDLIST pidl);
  99. // IPersistFolder2 Methods
  100. STDMETHODIMP GetCurFolder(LPITEMIDLIST *ppidl);
  101. // IContextMenu Methods -- This handles the background context menus
  102. STDMETHODIMP QueryContextMenu(
  103. HMENU hmenu,
  104. UINT indexMenu,
  105. UINT idCmdFirst,
  106. UINT idCmdLast,
  107. UINT uFlags);
  108. STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpici);
  109. STDMETHODIMP GetCommandString(
  110. UINT_PTR idCmd,
  111. UINT uType,
  112. UINT *pwReserved,
  113. LPTSTR pszName,
  114. UINT cchMax);
  115. protected:
  116. ~CControlFolder();
  117. UINT m_cRef;
  118. LPITEMIDLIST m_pidl;
  119. LPMALLOC m_pMalloc;
  120. };
  121. #endif