Leaked source code of windows server 2003
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.

72 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 AppIsThemed();
  22. BOOL CustomAppTheme();
  23. BOOL WindowHasTheme(HWND hwnd);
  24. HRESULT OpenWindowThemeFile(HWND hwnd, CUxThemeFile **ppThemeFile);
  25. HRESULT LoadCustomAppThemeIfFound();
  26. DWORD GetAppFlags();
  27. void SetAppFlags(DWORD dwFlags);
  28. void SetPreviewThemeFile(HANDLE handle, HWND hwnd);
  29. void ResetAppTheme(int iChangeNum, BOOL fMsgCheck, BOOL *pfChanged, BOOL *pfFirstMsg);
  30. BOOL IsSystemThemeActive();
  31. //---- themefile obj list ----
  32. HRESULT OpenThemeFile(HANDLE handle, CUxThemeFile **ppThemeFile);
  33. HRESULT BumpRefCount(CUxThemeFile *pThemeFile);
  34. void CloseThemeFile(CUxThemeFile *pThemeFile);
  35. //---- foreign window tracking ----
  36. BOOL GetForeignWindows(HWND **ppHwnds, int *piCount);
  37. BOOL OnWindowDestroyed(HWND hwnd);
  38. BOOL HasThemeChanged();
  39. #ifdef DEBUG
  40. void DumpFileHolders();
  41. #endif
  42. protected:
  43. //---- helper methods ----
  44. BOOL TrackForeignWindow(HWND hwnd);
  45. //---- data ----
  46. BOOL _fCustomAppTheme;
  47. CUxThemeFile *_pPreviewThemeFile;
  48. HWND _hwndPreview;
  49. CUxThemeFile *_pAppThemeFile;
  50. int _iChangeNum; // last change number from theme service
  51. int _iFirstMsgChangeNum; // last change number from WM_THEMECHANGED_TRIGGER msg
  52. BOOL _fCompositing;
  53. BOOL _fFirstTimeHooksOn;
  54. BOOL _fNewThemeDiscovered;
  55. DWORD _dwAppFlags;
  56. //---- file list ----
  57. CSimpleArray<THEME_FILE_ENTRY> _ThemeEntries;
  58. //---- foreign window list ----
  59. CSimpleArray<HWND> _ForeignWindows;
  60. CRITICAL_SECTION _csAppInfo;
  61. };
  62. //---------------------------------------------------------------------------