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.

131 lines
4.5 KiB

  1. /*****************************************************************************\
  2. FILE: store.h
  3. DESCRIPTION:
  4. This file will get and set effect settings into the persisted store.
  5. That persisted store is the registery and in SystemParametersInfo.
  6. BryanSt 4/17/2000
  7. Copyright (C) Microsoft Corp 2000-2000. All rights reserved.
  8. \*****************************************************************************/
  9. #ifndef _STORE_H
  10. #define _STORE_H
  11. // Name of the file that holds each icon, and an index for which icon to use in the file
  12. typedef struct tagIconKeys
  13. {
  14. TCHAR szOldFile[MAX_PATH];
  15. int iOldIndex;
  16. TCHAR szNewFile[MAX_PATH];
  17. int iNewIndex;
  18. }ICONDATA;
  19. // Registry Info for the icons
  20. typedef struct tagIconRegKeys
  21. {
  22. const CLSID* pclsid;
  23. TCHAR szIconValue[16];
  24. int iTitleResource;
  25. int iDefaultTitleResource;
  26. LPCWSTR szDefault;
  27. int nDefaultIndex;
  28. }ICONREGKEYS;
  29. static const ICONREGKEYS c_aIconRegKeys[] =
  30. {
  31. { &CLSID_MyComputer, TEXT("\0"), 0, IDS_MYCOMPUTER, L"%WinDir%\\explorer.exe", 0},
  32. { &CLSID_MyDocuments, TEXT("\0"), 0, IDS_MYDOCUMENTS, L"%WinDir%\\SYSTEM32\\mydocs.dll", 0},
  33. #ifdef INET_EXP_ICON
  34. { &CLSID_Internet, TEXT("\0"), 0, IDS_INTERNET, L"", 0},
  35. #endif
  36. { &CLSID_NetworkPlaces, TEXT("\0"), 0, IDS_NETNEIGHBOUR, L"%WinDir%\\SYSTEM32\\shell32.dll", 17},
  37. { &CLSID_RecycleBin, TEXT("full"), IDS_FULL, IDS_TRASHFULL, L"%WinDir%\\SYSTEM32\\shell32.dll", 32},
  38. { &CLSID_RecycleBin, TEXT("empty"), IDS_EMPTY, IDS_TRASHEMPTY, L"%WinDir%\\SYSTEM32\\shell32.dll", 31},
  39. #ifdef DIRECTORY_ICON
  40. { &CLSID_ShellFSFolder, TEXT("\0"), 0, IDS_DIRECTORY, L"", 0},
  41. #endif
  42. };
  43. #define NUM_ICONS (ARRAYSIZE(c_aIconRegKeys))
  44. enum ICON_SIZE_TYPES {
  45. ICON_DEFAULT = 0,
  46. ICON_LARGE = 1,
  47. ICON_INDETERMINATE = 2
  48. };
  49. #define ICON_DEFAULT_SMALL 16
  50. #define ICON_DEFAULT_NORMAL 32
  51. #define ICON_DEFAULT_LARGE 48
  52. #define MENU_EFFECT_FADE 1
  53. #define MENU_EFFECT_SCROLL 2
  54. #define FONT_SMOOTHING_MONO 0
  55. #define FONT_SMOOTHING_AA 1
  56. #define FONT_SMOOTHING_CT 2
  57. #define PATH_WIN 0
  58. #define PATH_SYS 1
  59. #define PATH_IEXP 2
  60. class CEffectState
  61. {
  62. public:
  63. // Private Member Variables
  64. ICONDATA _IconData[NUM_ICONS];
  65. int _nLargeIcon; // Large Icon State (iOldLI, iNewLI)
  66. int _nHighIconColor; // High Icon Colour (iOldHIC, iNewHIC)
  67. WPARAM _wpMenuAnimation; // Menu Animation State (wOldMA, wNewMA)
  68. BOOL _fFontSmoothing; // Font Smoothing State (bOldSF, bNewSF)
  69. DWORD _dwFontSmoothingType; // Font Smoothing Type (dwOldSFT, dwNewSFT)
  70. BOOL _fDragWindow; // Drag Window State (bOldDW, bNewDW)
  71. BOOL _fKeyboardIndicators; // Keyboard Indicators (uOldKI, uNewKI)
  72. DWORD _dwAnimationEffect; // Animation Effect (dwOldEffect, dwNewEffect)
  73. BOOL _fMenuShadows; // Show Menu Shadows
  74. // Old values (before they were dirtied)
  75. int _nOldLargeIcon; // Large Icon State (iOldLI)
  76. int _nOldHighIconColor; // High Icon Colour (iOldHIC)
  77. WPARAM _wpOldMenuAnimation; // Menu Animation State (wOldMA)
  78. BOOL _fOldFontSmoothing; // Font Smoothing State (bOldSF)
  79. DWORD _dwOldFontSmoothingType; // Font Smoothing Type (dwOldSFT)
  80. BOOL _fOldDragWindow; // Drag Window State (bOldDW)
  81. BOOL _fOldKeyboardIndicators; // Keyboard Indicators (uOldKI)
  82. DWORD _dwOldAnimationEffect; // Animation Effect (dwOldEffect)
  83. BOOL _fOldMenuShadows; // Show Menu Shadows
  84. // Private Member Functions
  85. HRESULT Load(void);
  86. HRESULT Save(void);
  87. HRESULT Clone(OUT CEffectState ** ppEffectClone);
  88. BOOL IsDirty(void);
  89. BOOL HasIconsChanged(IN CEffectState * pCurrent);
  90. HRESULT GetIconPath(IN CLSID clsid, IN LPCWSTR pszName, IN LPWSTR pszPath, IN DWORD cchSize);
  91. HRESULT SetIconPath(IN CLSID clsid, IN LPCWSTR pszName, IN LPCWSTR pszPath, IN int nResourceID);
  92. CEffectState(void);
  93. virtual ~CEffectState(void);
  94. private:
  95. };
  96. int GetBitsPerPixel(void);
  97. extern HINSTANCE g_hmodShell32;
  98. #endif // _STORE_H