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.

106 lines
3.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: shellex.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef _SHELLEX_H_
  11. #define _SHELLEX_H_
  12. #include "nopin.h"
  13. class CCscShellExt : public IShellExtInit,
  14. IContextMenu,
  15. IShellIconOverlayIdentifier
  16. {
  17. LONG m_cRef;
  18. LPDATAOBJECT m_lpdobj; // interface passed in by shell
  19. DWORD m_dwUIStatus;
  20. TCHAR m_szLocalMachine[MAX_COMPUTERNAME_LENGTH+1];
  21. CNoPinList m_NoPinList;
  22. public:
  23. CCscShellExt() : m_cRef(1), m_lpdobj(NULL), m_dwUIStatus(0)
  24. {
  25. DllAddRef();
  26. m_szLocalMachine[0] = TEXT('\0');
  27. ULONG n = ARRAYSIZE(m_szLocalMachine);
  28. GetComputerName(m_szLocalMachine, &n);
  29. }
  30. ~CCscShellExt()
  31. {
  32. if (m_lpdobj)
  33. m_lpdobj->Release();
  34. DllRelease();
  35. }
  36. static HRESULT WINAPI CreateInstance(REFIID riid, LPVOID *ppv);
  37. // IUnknown methods
  38. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  39. STDMETHODIMP_(ULONG) AddRef();
  40. STDMETHODIMP_(ULONG) Release();
  41. // IShellExtInit method
  42. STDMETHODIMP Initialize(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
  43. // IContextMenu methods
  44. STDMETHODIMP QueryContextMenu(HMENU hMenu,
  45. UINT indexMenu,
  46. UINT idCmdFirst,
  47. UINT idCmdLast,
  48. UINT uFlags);
  49. STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
  50. STDMETHODIMP GetCommandString(UINT_PTR idCmd,
  51. UINT uFlags,
  52. UINT FAR *reserved,
  53. LPSTR pszName,
  54. UINT cchMax);
  55. // IShellIconOverlayIdentifier methods
  56. STDMETHODIMP IsMemberOf(LPCWSTR pwszPath,
  57. DWORD dwAttrib);
  58. STDMETHODIMP GetOverlayInfo(LPWSTR pwszIconFile,
  59. int cchMax,
  60. int * pIndex,
  61. DWORD * pdwFlags);
  62. STDMETHODIMP GetPriority(int * pIPriority);
  63. private:
  64. STDMETHODIMP CheckOneFileStatus(LPCTSTR pszItem,
  65. DWORD dwAttr,
  66. BOOL bShareChecked,
  67. LPDWORD pdwStatus);
  68. STDMETHODIMP CheckFileStatus(LPDATAOBJECT pdobj,
  69. LPDWORD pdwStatus);
  70. STDMETHODIMP BuildFileList(LPDATAOBJECT pdobj,
  71. HWND hwndOwner,
  72. CscFilenameList * pfnl,
  73. LPBOOL pbSubDir = NULL);
  74. HRESULT CanAllFilesBePinned(IDataObject *pdtobj);
  75. static HRESULT FolderHasSubFolders(LPCTSTR pszPath, CscFilenameList *pfnl);
  76. static DWORD WINAPI _UnpinFilesThread(LPVOID pvData);
  77. static INT_PTR CALLBACK _ConfirmPinDlgProc(HWND, UINT, WPARAM, LPARAM);
  78. };
  79. typedef CCscShellExt *PCSCSHELLEXT;
  80. typedef DWORD (WINAPI* PFN_UNPINPROGRESSPROC)(LPCTSTR pszItem, LPARAM lpContext);
  81. void CscUnpinFileList(CscFilenameList*, BOOL, BOOL, LPCTSTR, PFN_UNPINPROGRESSPROC, LPARAM);
  82. BOOL ShareIsCacheable(LPCTSTR pszUNC,
  83. BOOL bPathIsFile,
  84. LPTSTR *ppszConnectionName,
  85. PDWORD pdwShareStatus = FALSE);
  86. BOOL ShareIsConnected(LPCTSTR pszUNC);
  87. BOOL ConnectShare(LPCTSTR pszUNC, LPTSTR *ppszAccessName);
  88. #endif // _SHELLEX_H_