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.

336 lines
11 KiB

  1. /*****************************************************************************\
  2. FILE: priv.h
  3. DESCRIPTION:
  4. This is the precompiled header for themeui.dll.
  5. BryanSt 4/4/2000 (Bryan Starbuck)
  6. Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
  7. \*****************************************************************************/
  8. #ifndef _PRIV_H_
  9. #define _PRIV_H_
  10. /*****************************************************************************\
  11. Global Includes
  12. \*****************************************************************************/
  13. #define WIN32_LEAN_AND_MEAN
  14. #define NOIME
  15. #define NOSERVICE
  16. // This stuff must run on Win95
  17. #define _WIN32_WINDOWS 0x0400
  18. #ifndef WINVER
  19. #define WINVER 0x0400
  20. #endif // WINVER
  21. #define STRICT
  22. #ifndef _WIN32_WINNT
  23. #define _WIN32_WINNT 0x0400
  24. #endif
  25. #define _ATL_APARTMENT_THREADED
  26. #undef _ATL_DLL
  27. #undef _ATL_DLL_IMPL
  28. #include <atlbase.h>
  29. //You may derive a class from CComModule and use it if you want to override
  30. //something, but do not change the name of _Module
  31. extern CComModule _Module;
  32. #include <atlcom.h>
  33. #include <atlctl.h>
  34. #include <windows.h>
  35. #include <windowsx.h>
  36. #include "resource.h"
  37. #include "coverwnd.h"
  38. #define _FIX_ENABLEMODELESS_CONFLICT // for shlobj.h
  39. //WinInet need to be included BEFORE ShlObjp.h
  40. #include <wininet.h>
  41. #include <urlmon.h>
  42. #include <shlobj.h>
  43. #include <exdisp.h>
  44. #include <objidl.h>
  45. #include <shellids.h> // Help IDs
  46. #include <shlwapi.h>
  47. #include <shlwapip.h>
  48. // HACKHACK: For the life of me, I can't get shlwapip.h to include the diffinitions of these.
  49. // I'm giving up and putting them inline. __IOleAutomationTypes_INTERFACE_DEFINED__ and
  50. // __IOleCommandTarget_INTERFACE_DEFINED__ need to be defined, which requires oaidl.h,
  51. // which requires hlink.h which requires rpcndr.h to come in the right order. Once I got that
  52. // far I found it still didn't work and a lot of more stuff is needed. The problem
  53. // is that shlwapi (exdisp/dspsprt/expdsprt/cnctnpt) or ATL will provide impls for
  54. // IConnectionPoint & IConnectionPointContainer, but one will conflict with the other.
  55. LWSTDAPI IConnectionPoint_SimpleInvoke(IConnectionPoint *pcp, DISPID dispidMember, DISPPARAMS * pdispparams);
  56. LWSTDAPI IConnectionPoint_OnChanged(IConnectionPoint *pcp, DISPID dispid);
  57. LWSTDAPIV IUnknown_CPContainerInvokeParam(IUnknown *punk, REFIID riidCP, DISPID dispidMember, VARIANTARG *rgvarg, UINT cArgs, ...);
  58. #include <shellapi.h>
  59. #include <shsemip.h>
  60. #include <crtfree.h>
  61. #include <ole2ver.h>
  62. #include <olectl.h>
  63. #include <shellp.h>
  64. #include <shdocvw.h>
  65. #include <commdlg.h>
  66. #include <shguidp.h>
  67. #include <isguids.h>
  68. #include <shdguid.h>
  69. #include <mimeinfo.h>
  70. #include <hlguids.h>
  71. #include <mshtmdid.h>
  72. #include <msident.h>
  73. #include <msxml.h>
  74. #include <Theme.h> // For ITheme interfaces
  75. #include <dispex.h> // IDispatchEx
  76. #include <perhist.h>
  77. #include <regapix.h>
  78. #include <shsemip.h>
  79. #include <shfusion.h> // For SHFusionInitialize()/SHFusionUninitialize()
  80. #include <help.h>
  81. #include <krnlcmn.h> // GetProcessDword
  82. #define DISALLOW_Assert // Force to use ASSERT instead of Assert
  83. #define DISALLOW_DebugMsg // Force to use TraceMsg instead of DebugMsg
  84. #include <debug.h>
  85. #include <urlhist.h>
  86. #include <setupapi.h>
  87. #include <cfgmgr32.h>
  88. #include <syssetup.h>
  89. #include <regstr.h> // for REGSTR_PATH_EXPLORE
  90. #define USE_SYSTEM_URL_MONIKER
  91. #include <urlmon.h>
  92. #include <inetreg.h>
  93. #define _INTSHCUT_ // get DECLSPEC_IMPORT stuff right for INTSHCUT.h
  94. #include <intshcut.h>
  95. #define HLINK_NO_GUIDS
  96. #include <hlink.h>
  97. #include <hliface.h>
  98. #include <docobj.h>
  99. #include <ccstock.h>
  100. #include <port32.h>
  101. #include <commctrl.h>
  102. #include <shpriv.h>
  103. #include <Prsht.h>
  104. // Include the automation definitions...
  105. #include <exdisp.h>
  106. #include <exdispid.h>
  107. #include <ocmm.h>
  108. #include <mshtmhst.h>
  109. #include <simpdata.h>
  110. #include <htiface.h>
  111. #include <objsafe.h>
  112. #include <dspsprt.h>
  113. #include <cowsite.h>
  114. #include <cobjsafe.h>
  115. #include <objclsid.h>
  116. #include <objwindow.h>
  117. #include <autosecurity.h>
  118. #include <guids.h>
  119. #include <tmschema.h>
  120. #include <uxtheme.h>
  121. #include <uxthemep.h>
  122. #include "deskcmmn.h"
  123. #include <cowsite.h>
  124. /*****************************************************************************\
  125. * Local Includes
  126. \*****************************************************************************/
  127. // Include frequently used headers.
  128. #include "util.h"
  129. #include "theme.h"
  130. #include "regutil.h"
  131. #include "themefile.h"
  132. #include <themeldr.h>
  133. #include "themeutils.h"
  134. #include "stgtheme.h"
  135. #include "appScheme.h"
  136. #include "thScheme.h"
  137. #include "PreviewSM.h"
  138. #include "deskcplext.h"
  139. #include "dragsize.h"
  140. #include "coverwnd.h"
  141. #include "settings.h"
  142. #include "advdlg.h"
  143. #include "fontfix.h"
  144. #include <tmreg.h>
  145. // Trace flags
  146. #define TF_WMTHEME 0x00000100 // Themes
  147. #define TF_THEMEUI_PERF 0x00000200 // Perf
  148. #define TF_DUMP_DEVMODE 0x00000400
  149. #define TF_DUMP_CSETTINGS 0x00000800
  150. #define TF_THEMEUI_SYSMETRICS 0x00001000 // Perf
  151. #include <w4warn.h>
  152. /*****************************************************************************\
  153. *
  154. * Global Helper Macros/Typedefs
  155. *
  156. \*****************************************************************************/
  157. EXTERN_C HINSTANCE g_hinst; // My instance handle
  158. #define HINST_THISDLL g_hinst
  159. STDAPI_(void) DllAddRef(void);
  160. STDAPI_(void) DllRelease(void);
  161. #define CALLWNDPROC WNDPROC
  162. #define MAX_PAGES 100
  163. // Detect "." or ".." as invalid files
  164. #define IS_VALID_FILE(str) (!(('.' == str[0]) && (('\0' == str[1]) || (('.' == str[1]) && ('\0' == str[2])))))
  165. /*****************************************************************************\
  166. *
  167. * Global state management.
  168. *
  169. * DLL reference count, DLL critical section.
  170. *
  171. \*****************************************************************************/
  172. void DllAddRef(void);
  173. void DllRelease(void);
  174. #define NULL_FOR_EMPTYSTR(str) (((str) && (str)[0]) ? str : NULL)
  175. typedef void (*LISTPROC)(UINT flm, LPVOID pv);
  176. #define RECTWIDTH(rc) ((rc).right - (rc).left)
  177. #define RECTHEIGHT(rc) ((rc).bottom - (rc).top)
  178. /*****************************************************************************\
  179. * Local Includes
  180. \*****************************************************************************/
  181. // This is defined in WININET.CPP
  182. typedef LPVOID HINTERNET;
  183. typedef HGLOBAL HIDA;
  184. #define QW_MAC 0xFFFFFFFFFFFFFFFF
  185. #define INTERNET_MAX_PATH_LENGTH 2048
  186. #define INTERNET_MAX_SCHEME_LENGTH 32 // longest protocol name length
  187. #define MAX_URL_STRING (INTERNET_MAX_SCHEME_LENGTH \
  188. + sizeof("://") \
  189. + INTERNET_MAX_PATH_LENGTH)
  190. #define SZ_EMPTY TEXT("")
  191. #define EMPTYSTR_FORNULL(str) ((str) ? (str) : SZ_EMPTY)
  192. // Features (This is where they are turned on and off)
  193. // With this feature on, we demote the advanced appearances
  194. // options into an "Advanced" subdialog.
  195. #define FEATURE_DEMOTE_ADVANCED_APPEAROPTIONS
  196. // Do we have personal.msstyles in the product yet.
  197. //#define FEATURE_PERSONAL_SKIN_ENABLED
  198. // The uxtheme visual style code has problems with being compatible
  199. // with system metrics. Apps will get system metric sizes (like captionbar height)
  200. // and paint accordingly. If uxtheme paints correctly, it will
  201. // use the captionbar height and be compatible with the app.
  202. // If it cannot do this, then the .msstyles file specifies system metrics
  203. // that do work and we try to discourage the user from changing the
  204. // system metrics to other values by disabling the advanced button
  205. // on the Appearance tab. This is a hack because the user can
  206. // change the values in via USER32 directly.
  207. #define FEATURE_ENABLE_ADVANCED_WITH_SKINSON
  208. // When selecting certain legacy color schemes, like "High Contrast Black", the SPI_SETHIGHCONTRAST
  209. // bit should be set. This wasn't done in Win2k but should be done.
  210. // This is currently turned off until MicW will implement a flag for SPI_SETHIGHCONTRAST
  211. // that will prevent sethc.exe from running.
  212. //#define FEATURE_SETHIGHCONTRASTSPI
  213. #ifndef _WIN64
  214. #define ENABLE_IA64_VISUALSTYLES
  215. #else // _WIN64
  216. // We don't want to install the theme files that require visual styles since
  217. // they aren't supported on ia64 (yet). Win #175788
  218. //#define ENABLE_IA64_VISUALSTYLES
  219. #endif // _WIN64
  220. // String Constants
  221. // Registry
  222. #define SZ_WINDOWMETRICS TEXT("Control Panel\\Desktop\\WindowMetrics")
  223. #define SZ_APPLIEDDPI TEXT("AppliedDPI")
  224. // PropertyBag Propertyes
  225. #define SZ_PBPROP_APPLY_THEMEFILE TEXT("Theme_ApplySettings") // When this is sent to a CThemeFile object, it will apply the settings that haven't been pulled out of it and placed in other Display Control Panel tabs.
  226. #define SZ_PBPROP_THEME_FILTER TEXT("ThemeFilter:") // The filter values of what parts of themes to apply.
  227. #define SZ_PBPROP_THEME_DISPLAYNAME TEXT("Theme_DisplayName") // Get the Theme display name for the currently selected item.
  228. #define SZ_PBPROP_THEME_SETSELECTION TEXT("Theme_SetSelectedEntree") // Set the item in the drop down and persist. The VT_BSTR
  229. #define SZ_PBPROP_THEME_LOADTHEME TEXT("Theme_LoadTheme") // Load the theme specified by the VT_BSTR value
  230. #define SZ_PBPROP_VSBEHAVIOR_FLATMENUS TEXT("VSBehavior_FlatMenus") // Does this visual style file want to use Flat menus (SPI_SETFLATMENUS)?
  231. #define SZ_PBPROP_COLORSCHEME_LEGACYNAME TEXT("ColorScheme_LegacyName") // VT_BSTR specifying the Legacy name. Like "Lilac (Large)"
  232. #define SZ_PBPROP_EFFECTS_MENUDROPSHADOWS TEXT("Effects_MenuDropShadows") // VT_BOOL specifying if MenuDropShadows in on
  233. #define SZ_PBPROP_HASSYSMETRICS TEXT("Theme_HasSystemMetrics") // VT_BOOL specifying if MenuDropShadows in on
  234. #define SIZE_THEME_FILTER_STR (ARRAYSIZE(SZ_PBPROP_THEME_FILTER) - 1)
  235. // Parsing Characters
  236. #define CH_ADDRESS_SEPARATOR L';'
  237. #define CH_ADDRESS_QUOTES L'"'
  238. #define CH_EMAIL_START L'<'
  239. #define CH_EMAIL_END L'>'
  240. #define CH_EMAIL_AT L'@'
  241. #define CH_EMAIL_DOMAIN_SEPARATOR L'.'
  242. #define CH_HTML_ESCAPE L'%'
  243. #define CH_COMMA L','
  244. #define COLLECTION_SIZE_UNINITIALIZED -1
  245. /*****************************************************************************\
  246. Object Constructors
  247. \*****************************************************************************/
  248. HRESULT CClassFactory_Create(REFCLSID rclsid, REFIID riid, LPVOID * ppvObj);
  249. HRESULT CThemeUIPages_CreateInstance(IN IUnknown * punkOuter, IN REFIID riid, OUT LPVOID * ppvObj);
  250. #endif // _PRIV_H_