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.

72 lines
2.8 KiB

  1. /*****************************************************************************
  2. * ftpicon.h
  3. *****************************************************************************/
  4. #ifndef _FTPICON_H
  5. #define _FTPICON_H
  6. INT GetFtpIcon(UINT uFlags, BOOL fIsRoot);
  7. /*****************************************************************************
  8. CFtpIcon
  9. The stuff that tells the shell which icon to use.
  10. Just plain annoying. No real work is happening.
  11. Fortunately, the shell does most of the real work.
  12. Again, note that the szName is a plain char and not a TCHAR,
  13. because UNIX filenames are always ASCII.
  14. Extract() returning S_FALSE means "Could you do it for me? Thanks."
  15. *****************************************************************************/
  16. class CFtpIcon : public IExtractIconW
  17. , public IExtractIconA
  18. , public IQueryInfo
  19. {
  20. public:
  21. //////////////////////////////////////////////////////
  22. // Public Interfaces
  23. //////////////////////////////////////////////////////
  24. // *** IUnknown ***
  25. virtual STDMETHODIMP_(ULONG) AddRef(void);
  26. virtual STDMETHODIMP_(ULONG) Release(void);
  27. virtual STDMETHODIMP QueryInterface(REFIID riid, LPVOID * ppvObj);
  28. // *** IExtractIconA ***
  29. virtual STDMETHODIMP GetIconLocation(UINT uFlags, LPSTR szIconFile, UINT cchMax, int * piIndex, UINT * pwFlags);
  30. virtual STDMETHODIMP Extract(LPCSTR pszFile, UINT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIconSize) {return S_FALSE;};
  31. // *** IExtractIconW ***
  32. virtual STDMETHODIMP GetIconLocation(UINT uFlags, LPWSTR szIconFile, UINT cchMax, int * piIndex, UINT * pwFlags);
  33. virtual STDMETHODIMP Extract(LPCWSTR pszFile, UINT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIconSize) {return S_FALSE;};
  34. // *** IQueryInfo ***
  35. virtual STDMETHODIMP GetInfoTip(DWORD dwFlags, WCHAR **ppwszTip);
  36. virtual STDMETHODIMP GetInfoFlags(DWORD *pdwFlags);
  37. public:
  38. CFtpIcon();
  39. ~CFtpIcon(void);
  40. // Friend Functions
  41. friend HRESULT CFtpIcon_Create(CFtpFolder * pff, CFtpPidlList * pflHfpl, REFIID riid, LPVOID * ppv);
  42. friend HRESULT CFtpIcon_Create(CFtpFolder * pff, CFtpPidlList * pflHfpl, CFtpIcon ** ppfm);
  43. protected:
  44. // Private Member Variables
  45. int m_cRef;
  46. CFtpPidlList * m_pflHfpl; // FtpDir in which our pidls live
  47. int m_nRoot; // Gross HACKHACK (see CFtpIcon_Create)
  48. SINGLE_THREADED_MEMBER_VARIABLE;
  49. // Private Member Functions
  50. int ParseIconLocation(LPSTR pszIconFile);
  51. void GetDefaultIcon(LPSTR szIconFile, UINT cchMax, HKEY hk);
  52. HRESULT GetIconLocHkey(LPSTR szIconFile, UINT cchMax, LPINT pi, HKEY hk);
  53. };
  54. #endif // _FTPICON_H