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.

117 lines
2.9 KiB

  1. // precomp.h : include file for standard system include files,
  2. // or project specific include files that are used frequently,
  3. // but are changed infrequently
  4. #pragma once
  5. #define STRICT
  6. #define _ATL_APARTMENT_THREADED
  7. #define _ATL_NO_UUIDOF
  8. #define _ATL_NO_DEBUG_CRT
  9. // we have to provide ATLASSERT(x) with no debug crt
  10. // we don't use it, so make it do nothing
  11. #define ATLASSERT(x)
  12. #pragma warning(disable : 4100 4310)
  13. #include <windows.h>
  14. #include <shellapi.h>
  15. #include <port32.h>
  16. #include <commctrl.h>
  17. #include <wininet.h>
  18. #include <shlobj.h>
  19. #include <hlink.h>
  20. #include <shlobjp.h>
  21. #include <shlwapi.h>
  22. #include <shlwapip.h>
  23. #include <shellapi.h>
  24. #include <shlapip.h>
  25. #include <shlguidp.h>
  26. #include <shdispid.h>
  27. #include <ieguidp.h>
  28. #include <ccstock.h>
  29. #include "cfdefs.h"
  30. #include <comctrlp.h>
  31. #include <dpa.h>
  32. #include "resource.h"
  33. #include <gdiplus.h>
  34. using namespace Gdiplus;
  35. #include "shimgdata.h"
  36. #include <shfusion.h> // needs to be before ATL.
  37. #include <varutil.h>
  38. #include <shdguid.h>
  39. #include <debug.h>
  40. #include <atlbase.h>
  41. // needs to be defined before including atlcom.
  42. extern CComModule _Module;
  43. #include <atlcom.h>
  44. #include <atlctl.h>
  45. #include <atlwin.h>
  46. #define _ATL_TMP_NO_CSTRING
  47. #include <atltmp.h>
  48. #include "guids.h"
  49. #include <gdithumb.h>
  50. #include <docfile.h>
  51. #include <mshtmhst.h>
  52. #include <html.h>
  53. #include <extmsg.h>
  54. #include <runtask.h>
  55. #pragma warning(default : 4100 4310)
  56. #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
  57. #define MIN(x,y) ((x<y)?x:y)
  58. #define MAX(x,y) ((x>y)?x:y)
  59. #define SWAPLONG(a, b) { LONG t; t = a; a = b; b = t; }
  60. #define RECTWIDTH(rc) ((rc).right-(rc).left)
  61. #define RECTHEIGHT(rc) ((rc).bottom-(rc).top)
  62. STDAPI CImageData_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  63. STDAPI CImageDataFactory_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  64. STDAPI CPhotoVerbs_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  65. STDAPI CAutoplayForSlideShow_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  66. STDAPI CImgRecompress_CreateInstance(IUnknown* pUnkOuter, IUnknown** ppunk, LPCOBJECTINFO poi);
  67. class CGraphicsInit
  68. {
  69. ULONG_PTR _token;
  70. public:
  71. CGraphicsInit()
  72. {
  73. _token = 0;
  74. GdiplusStartupInput gsi;
  75. GdiplusStartup(&_token, &gsi, NULL);
  76. };
  77. ~CGraphicsInit()
  78. {
  79. if (_token != 0)
  80. {
  81. GdiplusShutdown(_token);
  82. }
  83. };
  84. };
  85. // All non-ATL COM objects must derive from this class so the
  86. // DLL object reference count stays correct -- this ensures that
  87. // DllCanUnloadNow returns the correct value.
  88. class NonATLObject
  89. {
  90. public:
  91. NonATLObject() { _Module.Lock(); }
  92. ~NonATLObject() { _Module.Unlock(); }
  93. };
  94. //
  95. // Helper function for loading SP1 strings
  96. int LoadSPString(int idStr, LPTSTR pszString, int cch);