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.

104 lines
4.9 KiB

  1. /*****************************************************************************\
  2. FILE: themeutils.h
  3. DESCRIPTION:
  4. This class will load and save the "Theme" settings from their persisted
  5. state.
  6. BryanSt 5/26/2000
  7. Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
  8. \*****************************************************************************/
  9. #ifndef _THEMEUTIL_H
  10. #define _THEMEUTIL_H
  11. /////////////////////////////////////////////////////////////////////
  12. // String Constants
  13. /////////////////////////////////////////////////////////////////////
  14. // Registry Strings
  15. #define SZ_REGKEY_USERMETRICS TEXT("Control Panel\\Desktop\\WindowMetrics")
  16. #define SZ_REGKEY_CURRENTTHEME TEXT("Software\\Microsoft\\Plus!\\Themes\\Current") // Previously szPlus_CurTheme
  17. #define SZ_REGKEY_PROGRAMFILES TEXT("Software\\Microsoft\\Windows\\CurrentVersion")
  18. #define SZ_REGKEY_PLUS95DIR TEXT("Software\\Microsoft\\Plus!\\Setup") // PLUS95_KEY
  19. #define SZ_REGKEY_PLUS98DIR TEXT("Software\\Microsoft\\Plus!98") // PLUS98_KEY
  20. #define SZ_REGKEY_KIDSDIR TEXT("Software\\Microsoft\\Microsoft Kids\\Kids Plus!") // KIDS_KEY
  21. #define SZ_REGKEY_SOUNDS TEXT("AppEvents\\Schemes")
  22. #define SZ_REGVALUE_PLUS95DIR TEXT("DestPath") // PLUS95_PATH
  23. #define SZ_REGVALUE_PLUS98DIR TEXT("Path") // PLUS98_PATH
  24. #define SZ_REGVALUE_KIDSDIR TEXT("InstallDir") // KIDS_PATH
  25. #define SZ_REGVALUE_PROGRAMFILESDIR TEXT("ProgramFilesDir")
  26. #define SZ_REGVALUE_WALLPAPERSTYLE TEXT("WallpaperStyle")
  27. #define SZ_REGVALUE_TILEWALLPAPER TEXT("TileWallpaper")
  28. #define SZ_REGVALUE_STRETCH TEXT("Stretch")
  29. #define SZ_INISECTION_SCREENSAVER TEXT("boot")
  30. #define SZ_INISECTION_THEME TEXT("Theme")
  31. #define SZ_INISECTION_BACKGROUND TEXT("Control Panel\\Desktop")
  32. #define SZ_INISECTION_COLORS TEXT("Control Panel\\Colors")
  33. #define SZ_INISECTION_CURSORS TEXT("Control Panel\\Cursors")
  34. #define SZ_INISECTION_VISUALSTYLES TEXT("VisualStyles")
  35. #define SZ_INISECTION_MASTERSELECTOR TEXT("MasterThemeSelector")
  36. #define SZ_INISECTION_METRICS TEXT("Metrics")
  37. #define SZ_INISECTION_CONTROLINI TEXT("control.ini")
  38. #define SZ_INISECTION_SYSTEMINI TEXT("system.ini")
  39. #define SZ_INIKEY_SCREENSAVER TEXT("SCRNSAVE.EXE")
  40. #define SZ_INIKEY_BACKGROUND TEXT("Wallpaper")
  41. #define SZ_INIKEY_VISUALSTYLE TEXT("Path")
  42. #define SZ_INIKEY_VISUALSTYLECOLOR TEXT("ColorStyle")
  43. #define SZ_INIKEY_VISUALSTYLESIZE TEXT("Size")
  44. #define SZ_INIKEY_ICONMETRICS TEXT("IconMetrics")
  45. #define SZ_INIKEY_NONCLIENTMETRICS TEXT("NonclientMetrics")
  46. #define SZ_INIKEY_DEFAULTVALUE TEXT("DefaultValue")
  47. #define SZ_INIKEY_THEMEMAGICTAG TEXT("MTSM")
  48. #define SZ_INIKEY_THEMEMAGICVALUE TEXT("DABJDKT")
  49. #define SZ_INIKEY_DISPLAYNAME TEXT("DisplayName")
  50. #define SZ_INIKEY_CURSORSCHEME TEXT("DefaultValue")
  51. /////////////////////////////////////////////////////////////////////
  52. // Data Structures
  53. /////////////////////////////////////////////////////////////////////
  54. // for ConfirmFile()
  55. #define CF_EXISTS 1
  56. #define CF_FOUND 2
  57. #define CF_NOTFOUND 3
  58. /////////////////////////////////////////////////////////////////////
  59. // Shared Function
  60. /////////////////////////////////////////////////////////////////////
  61. HRESULT GetPlusThemeDir(IN LPTSTR pszPath, IN int cchSize);
  62. HRESULT ExpandThemeTokens(IN LPCTSTR pszThemeFile, IN LPTSTR pszPath, IN int cchSize);
  63. int ConfirmFile(IN LPTSTR lpszPath, IN BOOL bUpdate);
  64. void InitFrost(void);
  65. int WriteBytesToBuffer(IN LPTSTR pszInput, IN void * pOut, IN int cbSize);
  66. void ConvertIconMetricsToWIDE(LPICONMETRICSA aIM, LPICONMETRICSW wIM);
  67. void ConvertNCMetricsToWIDE(LPNONCLIENTMETRICSA aNCM, LPNONCLIENTMETRICSW wNCM);
  68. void ConvertIconMetricsToANSI(LPICONMETRICSW wIM, LPICONMETRICSA aIM);
  69. void ConvertNCMetricsToANSI(LPNONCLIENTMETRICSW wNCM, LPNONCLIENTMETRICSA aNCM);
  70. void ConvertLogFontToANSI(LPLOGFONTW wLF, LPLOGFONTA aLF);
  71. HRESULT ConvertBinaryToINIByteString(BYTE * pBytes, DWORD cbSize, LPWSTR * ppszStringOut);
  72. COLORREF RGBStringToColor(LPTSTR lpszRGB);
  73. BOOL IsValidThemeFile(IN LPCWSTR pszTest);
  74. HRESULT GetIconMetricsFromSysMetricsAll(SYSTEMMETRICSALL * pSystemMetrics, LPICONMETRICSA pIconMetrics, DWORD cchSize);
  75. void TransmitFontCharacteristics(PLOGFONT plfDst, PLOGFONT plfSrc, int iXmit);
  76. #define TFC_STYLE 1
  77. #define TFC_SIZE 2
  78. /////////////////////////////////////////////////////////////////////
  79. // The following functions are used to "SnapShot" settings and save
  80. // or restore them from a .theme file.
  81. /////////////////////////////////////////////////////////////////////
  82. HRESULT SnapShotLiveSettingsToTheme(IPropertyBag * pPropertyBag, LPCWSTR pszPath, ITheme ** ppTheme);
  83. #endif // _THEMEUTIL_H