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.

74 lines
2.3 KiB

  1. //---------------------------------------------------------------------------
  2. // AppInfo.h - manages app-level theme information (thread safe)
  3. //---------------------------------------------------------------------------
  4. #pragma once
  5. //---------------------------------------------------------------------------
  6. #include "ThemeFile.h"
  7. //---------------------------------------------------------------------------
  8. struct THEME_FILE_ENTRY
  9. {
  10. int iRefCount;
  11. CUxThemeFile *pThemeFile;
  12. };
  13. //---------------------------------------------------------------------------
  14. class CAppInfo
  15. {
  16. public:
  17. //---- public methods ----
  18. CAppInfo();
  19. ~CAppInfo();
  20. void ClosePreviewThemeFile();
  21. BOOL CompositingEnabled();
  22. BOOL AppIsThemed();
  23. BOOL CustomAppTheme();
  24. BOOL WindowHasTheme(HWND hwnd);
  25. HRESULT OpenWindowThemeFile(HWND hwnd, CUxThemeFile **ppThemeFile);
  26. HRESULT LoadCustomAppThemeIfFound();
  27. DWORD GetAppFlags();
  28. HWND PreviewHwnd();
  29. void SetAppFlags(DWORD dwFlags);
  30. void SetPreviewThemeFile(HANDLE handle, HWND hwnd);
  31. void ResetAppTheme(int iChangeNum, BOOL fMsgCheck, BOOL *pfChanged, BOOL *pfFirstMsg);
  32. BOOL IsSystemThemeActive();
  33. //---- themefile obj list ----
  34. HRESULT OpenThemeFile(HANDLE handle, CUxThemeFile **ppThemeFile);
  35. HRESULT BumpRefCount(CUxThemeFile *pThemeFile);
  36. void CloseThemeFile(CUxThemeFile *pThemeFile);
  37. //---- foreign window tracking ----
  38. BOOL GetForeignWindows(HWND **ppHwnds, int *piCount);
  39. BOOL OnWindowDestroyed(HWND hwnd);
  40. BOOL HasThemeChanged();
  41. #ifdef DEBUG
  42. void DumpFileHolders();
  43. #endif
  44. protected:
  45. //---- helper methods ----
  46. BOOL TrackForeignWindow(HWND hwnd);
  47. //---- data ----
  48. BOOL _fCustomAppTheme;
  49. CUxThemeFile *_pPreviewThemeFile;
  50. HWND _hwndPreview;
  51. CUxThemeFile *_pAppThemeFile;
  52. int _iChangeNum; // last change number from theme service
  53. int _iFirstMsgChangeNum; // last change number from WM_THEMECHANGED_TRIGGER msg
  54. BOOL _fCompositing;
  55. BOOL _fFirstTimeHooksOn;
  56. BOOL _fNewThemeDiscovered;
  57. DWORD _dwAppFlags;
  58. //---- file list ----
  59. CSimpleArray<THEME_FILE_ENTRY> _ThemeEntries;
  60. //---- foreign window list ----
  61. CSimpleArray<HWND> _ForeignWindows;
  62. CRITICAL_SECTION _csAppInfo;
  63. };
  64. //---------------------------------------------------------------------------