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.

152 lines
4.4 KiB

  1. // fakewin.h
  2. //
  3. // include file for FAKEWIN.C
  4. //
  5. // Frosting: Master Theme Selector for Windows '95
  6. // Copyright (c) 1994-1998 Microsoft Corporation. All rights reserved.
  7. //
  8. // external routines
  9. extern int FAR WriteBytesToBuffer(LPTSTR);
  10. //
  11. // typedefs and defines
  12. // fonts
  13. #define FONT_NONE -1
  14. #define FONT_CAPTION 0
  15. #define FONT_MENU 1
  16. #define FONT_ICONTITLE 2
  17. #define FONT_STATUS 3
  18. #define FONT_MSGBOX 4
  19. //#define FONT_SMCAPTION 1
  20. #define NUM_FONTS 5
  21. typedef struct {
  22. HFONT hfont;
  23. LOGFONT lf;
  24. } LOOK_FONT;
  25. typedef struct {
  26. int iFont;
  27. RECT rc;
  28. } LOOK_ELEMENT;
  29. // JDK:
  30. // Actually, this only seems to be used to get the count of elements
  31. // directly following this defn. Otherwise unused in CPL code.
  32. //
  33. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  34. //this order has to match the array order in lookdlg.c // g_elements below
  35. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  36. enum _ELEMENTS {
  37. ELEMENT_APPSPACE = 0,
  38. // ELEMENT_DESKTOP,
  39. ELEMENT_INACTIVEBORDER,
  40. ELEMENT_ACTIVEBORDER,
  41. ELEMENT_INACTIVECAPTION,
  42. ELEMENT_INACTIVESYSBUT1,
  43. ELEMENT_INACTIVESYSBUT2,
  44. ELEMENT_ACTIVECAPTION,
  45. ELEMENT_ACTIVESYSBUT1,
  46. ELEMENT_ACTIVESYSBUT2,
  47. ELEMENT_MENUNORMAL,
  48. ELEMENT_MENUSELECTED,
  49. ELEMENT_MENUDISABLED,
  50. ELEMENT_WINDOW,
  51. ELEMENT_MSGBOX,
  52. ELEMENT_MSGBOXCAPTION,
  53. ELEMENT_MSGBOXSYSBUT,
  54. ELEMENT_SCROLLBAR,
  55. ELEMENT_SCROLLUP,
  56. ELEMENT_SCROLLDOWN,
  57. ELEMENT_BUTTON,
  58. // ELEMENT_SMCAPTION,
  59. ELEMENT_ICON,
  60. ELEMENT_ICONHORZSPACING,
  61. ELEMENT_ICONVERTSPACING,
  62. ELEMENT_INFO
  63. };
  64. // BOGUS: need to get a size from somewhere
  65. #define NUM_ELEMENTS (ELEMENT_INFO+1)
  66. // KEEP IN SYNC WITH pRegColors in REGUTILS.C!!
  67. // BOGUS twice: need to get a size from somewhere
  68. #define MAX_COLORS (COLOR_GRADIENTINACTIVECAPTION+1)
  69. //
  70. // globals
  71. // jdk: see note above enum above
  72. // NOTE: the order in g_elements must match the enum order above
  73. HPALETTE hpal3D = NULL; // only exist if palette device
  74. BOOL bPalette = FALSE; // is this a palette device?
  75. int cyFixedBorder;
  76. int cxFixedBorder;
  77. int cxFixedEdge;
  78. int cyFixedEdge;
  79. int cxSize; // ***DEBUG*** this shouldn't really be fixed, should it?
  80. LOOK_FONT g_fonts[NUM_FONTS];
  81. COLORREF g_rgb[MAX_COLORS];
  82. HBRUSH g_brushes[MAX_COLORS];
  83. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  84. //this order has to match the enum order above
  85. // jdk: see also not above
  86. //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  87. LOOK_ELEMENT g_elements[] = {
  88. /* ELEMENT_APPSPACE */ {FONT_NONE, {-1,-1,-1,-1}},
  89. // /* ELEMENT_DESKTOP */ {FONT_NONE, {-1,-1,-1,-1}},
  90. /* ELEMENT_INACTIVEBORDER */ {FONT_NONE, {-1,-1,-1,-1}},
  91. /* ELEMENT_ACTIVEBORDER */ {FONT_NONE, {-1,-1,-1,-1}},
  92. /* ELEMENT_INACTIVECAPTION */ {FONT_CAPTION, {-1,-1,-1,-1}},
  93. /* ELEMENT_INACTIVESYSBUT1 */ {FONT_NONE, {-1,-1,-1,-1}},
  94. /* ELEMENT_INACTIVESYSBUT2 */ {FONT_NONE, {-1,-1,-1,-1}},
  95. /* ELEMENT_ACTIVECAPTION */ {FONT_CAPTION, {-1,-1,-1,-1}},
  96. /* ELEMENT_ACTIVESYSBUT1 */ {FONT_NONE, {-1,-1,-1,-1}},
  97. /* ELEMENT_ACTIVESYSBUT2 */ {FONT_NONE, {-1,-1,-1,-1}},
  98. /* ELEMENT_MENUNORMAL */ {FONT_MENU, {-1,-1,-1,-1}},
  99. /* ELEMENT_MENUSELECTED */ {FONT_MENU, {-1,-1,-1,-1}},
  100. /* ELEMENT_MENUDISABLED */ {FONT_MENU, {-1,-1,-1,-1}},
  101. /* ELEMENT_WINDOW */ {FONT_NONE, {-1,-1,-1,-1}},
  102. /* ELEMENT_MSGBOX */ {FONT_MSGBOX, {-1,-1,-1,-1}},
  103. /* ELEMENT_MSGBOXCAPTION */ {FONT_CAPTION, {-1,-1,-1,-1}},
  104. /* ELEMENT_MSGBOXSYSBUT */ {FONT_CAPTION, {-1,-1,-1,-1}},
  105. // do not even try to set a scr
  106. /* ELEMENT_SCROLLBAR */ {FONT_NONE, {-1,-1,-1,-1}},
  107. /* ELEMENT_SCROLLUP */ {FONT_NONE, {-1,-1,-1,-1}},
  108. /* ELEMENT_SCROLLDOWN */ {FONT_NONE, {-1,-1,-1,-1}},
  109. /* ELEMENT_BUTTON */ {FONT_NONE, {-1,-1,-1,-1}},
  110. // /* ELEMENT_SMCAPTION */ {FONT_SMCAPTION, {-1,-1,-1,-1}},
  111. /* ELEMENT_ICON */ {FONT_ICONTITLE, {-1,-1,-1,-1}},
  112. /* ELEMENT_ICONHORZSPACING */ {FONT_NONE, {-1,-1,-1,-1}},
  113. /* ELEMENT_ICONVERTSPACING */ {FONT_NONE, {-1,-1,-1,-1}},
  114. /* ELEMENT_INFO */ {FONT_STATUS, {-1,-1,-1,-1}},
  115. };
  116. #define RCZ(element) g_elements[element].rc
  117. TCHAR szFakeActive[40];
  118. TCHAR szFakeInactive[40];
  119. TCHAR szFakeMinimized[40];
  120. TCHAR szFakeIconTitle[40];
  121. TCHAR szFakeNormal[40];
  122. TCHAR szFakeDisabled[40];
  123. TCHAR szFakeSelected[40];
  124. TCHAR szFakeMsgBox[40];
  125. TCHAR szFakeButton[40];
  126. //TCHAR szFakeSmallCaption[40];
  127. TCHAR szFakeWindowText[40];
  128. TCHAR szFakeMsgBoxText[40];
  129. TCHAR szFakeABC[] = TEXT("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz");
  130. HMENU hmenuFake;