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.

86 lines
3.4 KiB

  1. //---------------------------------------------------------------------------//
  2. // globals.h - variables shared by uxtheme modules
  3. //---------------------------------------------------------------------------//
  4. #pragma once
  5. //---------------------------------------------------------------------------
  6. class CThemeServices; // forward
  7. class CAppInfo; // forward
  8. class CRenderList; // forward
  9. class CUxThemeFile; // forward
  10. class CBitmapCache; // forward
  11. //---------------------------------------------------------------------------
  12. #define PROPFLAGS_RESET_TRANSPARENT (1 << 0) // hwnd needs WS_EX_TRANSPARENT reset
  13. #define PROPFLAGS_RESET_COMPOSITED (1 << 1) // hwnd needs WS_EX_COMPOSITED reset
  14. //---------------------------------------------------------------------------
  15. #define WM_THEMECHANGED_TRIGGER WM_UAHINIT // reuse this msgnum with WPARAM != NULL
  16. //---------------------------------------------------------------------------//
  17. extern HINSTANCE g_hInst;
  18. extern WCHAR g_szProcessName[MAX_PATH];
  19. extern DWORD g_dwProcessId;
  20. extern BOOL g_fUxthemeInitialized;
  21. extern BOOL g_fEarlyHookRequest;
  22. extern HWND g_hwndFirstHooked;
  23. extern HWND g_hwndFirstHooked;
  24. extern CBitmapCache *g_pBitmapCacheScaled;
  25. extern CBitmapCache *g_pBitmapCacheUnscaled;
  26. //---------------------------------------------------------------------------
  27. // theme atoms
  28. enum THEMEATOM
  29. {
  30. THEMEATOM_Nil = -1,
  31. THEMEATOM_SUBIDLIST,
  32. THEMEATOM_SUBAPPNAME,
  33. THEMEATOM_HTHEME,
  34. THEMEATOM_PROPFLAGS,
  35. THEMEATOM_UNUSED__________, /// RECYCLE ME!
  36. THEMEATOM_SCROLLBAR,
  37. THEMEATOM_PRINTING,
  38. THEMEATOM_DLGTEXTURING,
  39. // insert new theme atom indices here
  40. THEMEATOM_NONCLIENT,
  41. THEMEATOM_Count
  42. };
  43. // 187504: Since whistler beta1, we use hardcoded atom values to avoid our atoms being
  44. // destroyed as a user logs off.
  45. #define HARDATOM_BASE 0xA910 // arbitrary, but less than 0xC000 (real atom base).
  46. #define HARDATOM_HIGH 0xA94F // range of 64 atoms
  47. inline ATOM GetThemeAtom( THEMEATOM ta )
  48. {
  49. ASSERT(ta > THEMEATOM_Nil && ta < THEMEATOM_Count);
  50. ATOM atom = (ATOM)(HARDATOM_BASE + ta);
  51. ASSERT(atom <= HARDATOM_HIGH);
  52. return atom;
  53. }
  54. //---------------------------------------------------------------------------
  55. enum THEMEHOOKSTATE
  56. {
  57. HS_INITIALIZED,
  58. HS_UNHOOKING,
  59. HS_UNINITIALIZED,
  60. };
  61. extern THEMEHOOKSTATE g_eThemeHookState;
  62. #define HOOKSACTIVE() (HS_INITIALIZED == g_eThemeHookState)
  63. #define UNHOOKING() (HS_UNHOOKING == g_eThemeHookState)
  64. //---------------------------------------------------------------------------
  65. extern CAppInfo *g_pAppInfo;
  66. extern CRenderList *g_pRenderList;
  67. //---------------------------------------------------------------------------
  68. BOOL GlobalsStartup();
  69. BOOL GlobalsShutdown();
  70. HRESULT BumpThemeFileRefCount(CUxThemeFile *pThemeFile);
  71. void CloseThemeFile(CUxThemeFile *pThemeFile);
  72. //---------------------------------------------------------------------------
  73. #define PRINTING_ASKING 1
  74. #define PRINTING_WINDOWDIDNOTHANDLE 2
  75. //---------------------------------------------------------------------------
  76. #define _WindowHasTheme(hwnd) (g_pAppInfo->WindowHasTheme(hwnd))
  77. //---------------------------------------------------------------------------