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.

73 lines
2.5 KiB

  1. #pragma once
  2. #include <shimgdata.h>
  3. // PRIORITIES
  4. #define PRIORITY_NORMAL ITSAT_DEFAULT_PRIORITY
  5. #define PRIORITY_M5 (PRIORITY_NORMAL - 5 * 0x1000)
  6. #define PRIORITY_M4 (PRIORITY_NORMAL - 4 * 0x1000)
  7. #define PRIORITY_M3 (PRIORITY_NORMAL - 3 * 0x1000)
  8. #define PRIORITY_M2 (PRIORITY_NORMAL - 2 * 0x1000)
  9. #define PRIORITY_M1 (PRIORITY_NORMAL - 1 * 0x1000)
  10. #define PRIORITY_NORMAL ITSAT_DEFAULT_PRIORITY
  11. #define PRIORITY_P1 (PRIORITY_NORMAL + 1 * 0x1000)
  12. #define PRIORITY_P2 (PRIORITY_NORMAL + 2 * 0x1000)
  13. #define PRIORITY_P3 (PRIORITY_NORMAL + 3 * 0x1000)
  14. #define PRIORITY_P4 (PRIORITY_NORMAL + 4 * 0x1000)
  15. #define PRIORITY_P5 (PRIORITY_NORMAL + 5 * 0x1000)
  16. #define PRIORITY_EXTRACT_FAST PRIORITY_P1
  17. #define PRIORITY_EXTRACT_NORMAL PRIORITY_NORMAL
  18. #define PRIORITY_EXTRACT_SLOW PRIORITY_M1
  19. class CGdiPlusThumb : public IExtractImage,
  20. public IPersistFile,
  21. public CComObjectRoot,
  22. public CComCoClass< CGdiPlusThumb, &CLSID_GdiThumbnailExtractor >
  23. {
  24. public:
  25. CGdiPlusThumb();
  26. ~CGdiPlusThumb();
  27. BEGIN_COM_MAP( CGdiPlusThumb )
  28. COM_INTERFACE_ENTRY( IExtractImage )
  29. COM_INTERFACE_ENTRY( IPersistFile )
  30. END_COM_MAP( )
  31. DECLARE_REGISTRY( CGdiPlusThumb,
  32. _T("Shell.ThumbnailExtract.GdiPlus.1"),
  33. _T("Shell.ThumbnailExtract.GdiPlus.1"),
  34. IDS_GDITHUMBEXTRACT_DESC,
  35. THREADFLAGS_APARTMENT);
  36. DECLARE_NOT_AGGREGATABLE( CGdiPlusThumb );
  37. // IExtractImage
  38. STDMETHOD (GetLocation)(LPWSTR pszPathBuffer, DWORD cch,
  39. DWORD *pdwPriority, const SIZE *prgSize,
  40. DWORD dwRecClrDepth, DWORD *pdwFlags);
  41. STDMETHOD (Extract)(HBITMAP *phBmpThumbnail);
  42. // IPersistFile
  43. STDMETHOD (GetClassID)(CLSID *pClassID);
  44. STDMETHOD (IsDirty)();
  45. STDMETHOD (Load)(LPCOLESTR pszFileName, DWORD dwMode);
  46. STDMETHOD (Save)(LPCOLESTR pszFileName, BOOL fRemember);
  47. STDMETHOD (SaveCompleted)(LPCOLESTR pszFileName);
  48. STDMETHOD (GetCurFile)(LPOLESTR *ppszFileName);
  49. protected:
  50. HRESULT CreateDibFromBitmapImage(HBITMAP *pbm);
  51. WCHAR m_szPath[MAX_PATH];
  52. SIZE m_rgSize;
  53. DWORD m_dwRecClrDepth;
  54. BOOL m_fOrigSize;
  55. BOOL m_fFillBackground;
  56. BOOL m_fHighQuality;
  57. IShellImageData * m_pImage;
  58. IShellImageDataFactory * m_pImageFactory;
  59. };