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.

127 lines
3.3 KiB

  1. //
  2. // dsctx.h : Declaration of ds context menu class
  3. //
  4. //+-------------------------------------------------------------------------
  5. //
  6. // Microsoft Windows
  7. // Copyright (C) Microsoft Corporation, 1992 - 1999
  8. //
  9. // File: dsctx.h
  10. //
  11. // Contents: context menu extension for DS classes
  12. //
  13. // History: 08-dec-97 jimharr Created
  14. //
  15. //--------------------------------------------------------------------------
  16. #ifndef __DSCTX_H_
  17. #define __DSCTX_H_
  18. #include "dssnap.h"
  19. //////////////////////////////////////////////////////////////////////////////////
  20. // CDSContextMenu
  21. class CContextMenuMultipleDeleteHandler;
  22. class CContextMenuSingleDeleteHandler;
  23. class CDSContextMenu:
  24. IShellExtInit,
  25. IContextMenu,
  26. public CComObjectRootEx<CComSingleThreadModel>,
  27. public CComCoClass<CDSContextMenu, &CLSID_DSContextMenu>
  28. {
  29. BEGIN_COM_MAP(CDSContextMenu)
  30. COM_INTERFACE_ENTRY(IShellExtInit)
  31. COM_INTERFACE_ENTRY(IContextMenu)
  32. END_COM_MAP()
  33. public:
  34. DECLARE_REGISTRY_CLSID()
  35. CDSContextMenu();
  36. ~CDSContextMenu();
  37. // IShellExtInit
  38. STDMETHODIMP Initialize(LPCITEMIDLIST pIDFolder,
  39. LPDATAOBJECT pDataObj,
  40. HKEY hKeyID );
  41. // IContextMenu
  42. STDMETHODIMP QueryContextMenu(HMENU hShellMenu,
  43. UINT indexMenu,
  44. UINT idCmdFirst,
  45. UINT idCmdLast,
  46. UINT uFlags );
  47. STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO lpcmi );
  48. STDMETHODIMP GetCommandString( UINT_PTR idCmd,
  49. UINT uFlags,
  50. UINT FAR* reserved,
  51. LPSTR pszName,
  52. UINT ccMax );
  53. private:
  54. // internal command handlers
  55. // misc entry points
  56. void DisableAccount(BOOL bDisable);
  57. void ModifyPassword();
  58. void ReplicateNow();
  59. void AddToGroup();
  60. void CopyObject();
  61. // MOVE entry point and helper functions
  62. void MoveObject();
  63. // DELETE entry point and helper functions
  64. void DeleteObject();
  65. HRESULT _Delete(LPCWSTR lpszPath,
  66. LPCWSTR lpszClass,
  67. CString * csName);
  68. HRESULT _DeleteSubtree(LPCWSTR lpszPath,
  69. CString * csName);
  70. // RENAME entry point
  71. void Rename();
  72. // internal helper functions
  73. void _GetExtraInfo(LPDATAOBJECT pDataObj);
  74. void _ToggleDisabledIcon(UINT index, BOOL bDisable);
  75. BOOL _WarningOnSheetsUp();
  76. void _NotifyDsFind(LPCWSTR* lpszNameDelArr,
  77. LPCWSTR* lpszClassDelArr,
  78. DWORD* dwFlagsDelArr,
  79. DWORD* dwProviderFlagsDelArr,
  80. UINT nDeletedCount);
  81. // member variables
  82. // data members to store info from data object
  83. CInternalFormatCracker m_internalFormat;
  84. CObjectNamesFormatCracker m_objectNamesFormat;
  85. CComPtr<IDataObject> m_spDataObject;
  86. // context information
  87. HWND m_hwnd;
  88. CDSComponentData* m_pCD;
  89. GUID m_CallerSnapin;
  90. IADsUser * m_pDsObject;
  91. DWORD m_UserAccountState;
  92. UINT m_fClasses; // flag to makr which classes we have in the multiple sel
  93. BOOL m_Advanced; // from the provider flags
  94. friend class CContextMenuMultipleDeleteHandler; // _Delete*() functions
  95. friend class CContextMenuSingleDeleteHandler;
  96. };
  97. #endif