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.

119 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. DfsShell.h
  5. Abstract:
  6. This is the header file for Dfs Shell Extension object which implements
  7. IShellIExtInit and IShellPropSheetExt.
  8. Author:
  9. Constancio Fernandes (ferns@qspl.stpp.soft.net) 12-Jan-1998
  10. Environment:
  11. NT only.
  12. --*/
  13. #ifndef __DFSSHELL_H_
  14. #define __DFSSHELL_H_
  15. #include "resource.h" // main symbols
  16. #include "DfsShPrp.h"
  17. #include "DfsPath.h"
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CDfsShell
  20. class ATL_NO_VTABLE CDfsShell :
  21. public CComObjectRootEx<CComSingleThreadModel>,
  22. public CComCoClass<CDfsShell, &CLSID_DfsShell>,
  23. public IShellExtInit,
  24. public IShellPropSheetExt
  25. {
  26. public:
  27. CDfsShell()
  28. {
  29. m_lpszFile = NULL;
  30. m_ppDfsAlternates = NULL;
  31. m_lpszEntryPath = NULL;
  32. }
  33. ~CDfsShell()
  34. {
  35. if (m_ppDfsAlternates)
  36. {
  37. for (int i = 0; NULL != m_ppDfsAlternates[i] ; i++)
  38. {
  39. delete m_ppDfsAlternates[i];
  40. }
  41. delete[] m_ppDfsAlternates;
  42. m_ppDfsAlternates = NULL;
  43. }
  44. if (m_lpszEntryPath)
  45. {
  46. delete [] m_lpszEntryPath;
  47. m_lpszEntryPath = NULL;
  48. }
  49. if (m_lpszFile)
  50. {
  51. delete [] m_lpszFile;
  52. m_lpszFile = NULL;
  53. }
  54. }
  55. DECLARE_REGISTRY_RESOURCEID(IDR_DFSSHELL)
  56. BEGIN_COM_MAP(CDfsShell)
  57. COM_INTERFACE_ENTRY(IShellExtInit)
  58. COM_INTERFACE_ENTRY(IShellPropSheetExt)
  59. END_COM_MAP()
  60. // IDfsShell
  61. public:
  62. // IShellExtInit Methods
  63. STDMETHOD (Initialize)
  64. (
  65. IN LPCITEMIDLIST pidlFolder, // Points to an ITEMIDLIST structure
  66. IN LPDATAOBJECT lpdobj, // Points to an IDataObject interface
  67. IN HKEY hkeyProgID // Registry key for the file object or folder type
  68. );
  69. //IShellPropSheetExt methods
  70. STDMETHODIMP AddPages
  71. (
  72. IN LPFNADDPROPSHEETPAGE lpfnAddPage,
  73. IN LPARAM lParam
  74. );
  75. STDMETHODIMP ReplacePage
  76. (
  77. IN UINT uPageID,
  78. IN LPFNADDPROPSHEETPAGE lpfnReplaceWith,
  79. IN LPARAM lParam
  80. );
  81. private:
  82. friend class CDfsShellExtProp;
  83. LPTSTR m_lpszFile;
  84. LPTSTR m_lpszEntryPath;
  85. CDfsShellExtProp m_psDfsShellExtProp;
  86. LPDFS_ALTERNATES* m_ppDfsAlternates;
  87. };
  88. #endif //__DFSSHELL_H_