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.

1335 lines
38 KiB

  1. /*----------------------------------------------------------------------------
  2. / Title;
  3. / util.c
  4. /
  5. / Authors;
  6. / David De Vorchik (daviddv)
  7. /
  8. / Modified by dsheldon
  9. /
  10. / Notes;
  11. / Code for handling bitmap images placed in the dialogs
  12. /----------------------------------------------------------------------------*/
  13. #include "msgina.h"
  14. #include <tchar.h>
  15. #include <shlwapi.h>
  16. #include <shlwapip.h>
  17. #include <winbrand.h>
  18. //
  19. // Loaded resources for the branding images that we display
  20. //
  21. HPALETTE g_hpalBranding = NULL; // palette the applies to all images
  22. HBITMAP g_hbmOtherDlgBrand = NULL;
  23. SIZE g_sizeOtherDlgBrand = { 0 };
  24. HBRUSH g_hbrOtherDlgBrand[2] = { 0 };
  25. HBITMAP g_hbmLogonBrand = NULL;
  26. SIZE g_sizeLogonBrand = { 0 };
  27. HBRUSH g_hbrLogonBrand[2] = { 0 };
  28. HBITMAP g_hbmBand = NULL;
  29. SIZE g_sizeBand = { 0 };
  30. BOOL g_fDeepImages = FALSE;
  31. BOOL g_fNoPalleteChanges = FALSE;
  32. VOID ReLoadBrandingImages(
  33. BOOL fDeepImages,
  34. BOOL* pfTextOnLarge,
  35. BOOL* pfTextOnSmall);
  36. /*-----------------------------------------------------------------------------
  37. / LoadImageGetSize
  38. / ----------------
  39. / Load the image returning the given HBITMAP, having done this we can
  40. / then get the size from it.
  41. /
  42. / In:
  43. / hInstance,resid = object to be loaded.
  44. / pSize = filled with size information about the object
  45. /
  46. / Out:
  47. / HBITMAP / == NULL if nothing loaded
  48. /----------------------------------------------------------------------------*/
  49. HBITMAP LoadBitmapGetSize(HINSTANCE hInstance, UINT resid, SIZE* pSize)
  50. {
  51. HBITMAP hResult = NULL;
  52. DIBSECTION ds = {0};
  53. //
  54. // Load the image from the resource then lets get the DIBSECTION header
  55. // from the bitmap object we can then read the size from it and
  56. // return that to the caller.
  57. //
  58. hResult = LoadImage(hInstance, MAKEINTRESOURCE(resid),
  59. IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
  60. if ( hResult )
  61. {
  62. GetObject(hResult, sizeof(ds), &ds);
  63. pSize->cx = ds.dsBmih.biWidth;
  64. pSize->cy = ds.dsBmih.biHeight;
  65. //
  66. // pSize->cy -ve then make +ve, -ve indicates bits are vertically
  67. // flipped (bottom left, top left).
  68. //
  69. if ( pSize->cy < 0 )
  70. pSize->cy -= 0;
  71. }
  72. return hResult;
  73. }
  74. /*-----------------------------------------------------------------------------
  75. / MoveChildren
  76. / ------------
  77. / Move the controls in the given by the specified delta.
  78. / In:
  79. / hWnd = window to move
  80. / dx/dy = delta to be applied
  81. /
  82. / Out:
  83. / -
  84. /----------------------------------------------------------------------------*/
  85. VOID MoveChildren(HWND hWnd, INT dx, INT dy)
  86. {
  87. HWND hWndSibling;
  88. RECT rc;
  89. //
  90. // walk all the children in the dialog adjusting their positions
  91. // by the delta.
  92. //
  93. for ( hWndSibling = GetWindow(hWnd, GW_CHILD) ; hWndSibling ; hWndSibling = GetWindow(hWndSibling, GW_HWNDNEXT))
  94. {
  95. GetWindowRect(hWndSibling, &rc);
  96. MapWindowPoints(NULL, GetParent(hWndSibling), (LPPOINT)&rc, 2);
  97. OffsetRect(&rc, dx, dy);
  98. SetWindowPos(hWndSibling, NULL,
  99. rc.left, rc.top, 0, 0,
  100. SWP_NOZORDER|SWP_NOSIZE);
  101. }
  102. //
  103. // having done that then lets adjust the parent size accordingl.
  104. //
  105. GetWindowRect(hWnd, &rc);
  106. MapWindowPoints(NULL, GetParent(hWnd), (LPPOINT)&rc, 2);
  107. SetWindowPos(hWnd, NULL,
  108. 0, 0, (rc.right-rc.left)+dx, (rc.bottom-rc.top)+dy,
  109. SWP_NOZORDER|SWP_NOMOVE);
  110. }
  111. /*-----------------------------------------------------------------------------
  112. / MoveControls
  113. / ------------
  114. / Load the image and add the control to the dialog.
  115. /
  116. / In:
  117. / hWnd = window to move controls in
  118. / aID, cID = array of control ids to be moved
  119. / dx, dy = deltas to apply to controls
  120. /
  121. / Out:
  122. / -
  123. /----------------------------------------------------------------------------*/
  124. VOID MoveControls(HWND hWnd, UINT* aID, INT cID, INT dx, INT dy, BOOL fSizeWnd)
  125. {
  126. RECT rc;
  127. // if hWnd is mirrored then move the controls in the other direction.
  128. if (GetWindowLongPtr(hWnd, GWL_EXSTYLE) & WS_EX_LAYOUTRTL)
  129. {
  130. dx = -dx;
  131. }
  132. while ( --cID >= 0 )
  133. {
  134. HWND hWndCtrl = GetDlgItem(hWnd, aID[cID]);
  135. if ( hWndCtrl )
  136. {
  137. GetWindowRect(hWndCtrl, &rc);
  138. MapWindowPoints(NULL, hWnd, (LPPOINT)&rc, 2);
  139. OffsetRect(&rc, dx, dy);
  140. SetWindowPos(hWndCtrl, NULL, rc.left, rc.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
  141. }
  142. }
  143. if ( fSizeWnd )
  144. {
  145. GetWindowRect(hWnd, &rc);
  146. MapWindowPoints(NULL, GetParent(hWnd), (LPPOINT)&rc, 2);
  147. SetWindowPos(hWnd, NULL,
  148. 0, 0, (rc.right-rc.left)+dx, (rc.bottom-rc.top)+dy,
  149. SWP_NOZORDER|SWP_NOMOVE);
  150. }
  151. }
  152. /*-----------------------------------------------------------------------------
  153. / LoadBrandingImages
  154. / ------------------
  155. / Load the resources required to brand the gina. This copes with
  156. / the depth changes.
  157. /
  158. / In:
  159. / Out:
  160. / -
  161. /----------------------------------------------------------------------------*/
  162. #define REGSTR_CUSTOM_BRAND /*HKEY_LOCAL_MACHINE\*/ \
  163. TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\CustomBrand\\")
  164. // bitmap subkeys
  165. #define REGSTR_OTHERDLG_4BIT TEXT("{F20B21BE-5E3D-11d2-8789-68CB20524153}")
  166. #define REGSTR_OTHERDLG_8BIT TEXT("{F20B21BF-5E3D-11d2-8789-68CB20524153}")
  167. #define REGSTR_LOGON_4BIT TEXT("{F20B21C0-5E3D-11d2-8789-68CB20524153}")
  168. #define REGSTR_LOGON_8BIT TEXT("{F20B21C1-5E3D-11d2-8789-68CB20524153}")
  169. #define REGSTR_BAND_4BIT TEXT("{F20B21C4-5E3D-11d2-8789-68CB20524153}")
  170. // The palette is read from the 8-bit band if applicable
  171. #define REGSTR_BAND_8BIT TEXT("{F20B21C5-5E3D-11d2-8789-68CB20524153}")
  172. #define REGSTR_PAINTTEXT_VAL TEXT("DontPaintText")
  173. // The default values of these subkeys should be of the form "<dllname>,-<resid>"
  174. // Example: msgina.dll,-130
  175. // The specified bitmap will be loaded from the dll & resid specified.
  176. BOOL GetBrandingModuleAndResid(LPCTSTR szRegKeyRoot, LPCTSTR szRegKeyLeaf, UINT idDefault,
  177. HINSTANCE* phMod, UINT* pidRes, BOOL* pfPaintText)
  178. {
  179. TCHAR* szRegKey = NULL;
  180. size_t bufferSize = 0;
  181. BOOL fCustomBmpUsed = FALSE;
  182. HKEY hkey;
  183. LONG lResult;
  184. *phMod = NULL;
  185. *pidRes = 0;
  186. *pfPaintText = TRUE;
  187. bufferSize =
  188. (_tcslen(szRegKeyRoot) + _tcslen(szRegKeyLeaf) + 1) * sizeof(TCHAR);
  189. szRegKey = (TCHAR*)LocalAlloc(LPTR, bufferSize);
  190. if( NULL == szRegKey )
  191. {
  192. goto recover;
  193. }
  194. _tcscpy(szRegKey, szRegKeyRoot);
  195. _tcscat(szRegKey, szRegKeyLeaf);
  196. lResult = RegOpenKeyEx(HKEY_LOCAL_MACHINE, szRegKey, 0 /*reserved*/,
  197. KEY_READ, &hkey);
  198. LocalFree(szRegKey);
  199. if (lResult == ERROR_SUCCESS)
  200. {
  201. TCHAR szUnexpanded[MAX_PATH + 1];
  202. TCHAR szModAndId[MAX_PATH + 1];
  203. DWORD dwType;
  204. DWORD cbData = sizeof(szUnexpanded);
  205. lResult = RegQueryValueEx(hkey, NULL /*default value*/, NULL /*reserved*/,
  206. &dwType, (LPBYTE) szUnexpanded, &cbData);
  207. if (lResult == ERROR_SUCCESS)
  208. {
  209. // expand any environment strings here
  210. if (ExpandEnvironmentStrings(szUnexpanded, szModAndId,
  211. ARRAYSIZE(szModAndId)) != 0)
  212. {
  213. // Get the module name and id number
  214. LPTSTR pchComma;
  215. int NegResId;
  216. pchComma = _tcsrchr(szModAndId, TEXT(','));
  217. // Ensure that the resid is present
  218. if (pchComma)
  219. {
  220. *pchComma = TEXT('\0');
  221. // Now szModAndId is just the module string - get the resid
  222. NegResId = _ttoi(pchComma + 1);
  223. // Ensure this is a NEGATIVE number!
  224. if (NegResId < 0)
  225. {
  226. BOOL fDontPaintText;
  227. // We're good to go
  228. *pidRes = 0 - NegResId;
  229. // Now load the specified module
  230. *phMod = LoadLibrary(szModAndId);
  231. fCustomBmpUsed = (*phMod != NULL);
  232. // Now see if we need to paint text on this bitmap
  233. cbData = sizeof(BOOL);
  234. RegQueryValueEx(hkey, REGSTR_PAINTTEXT_VAL, NULL,
  235. &dwType, (LPBYTE) &fDontPaintText, &cbData);
  236. *pfPaintText = !fDontPaintText;
  237. }
  238. }
  239. }
  240. }
  241. RegCloseKey(hkey);
  242. }
  243. recover:
  244. // If we didn't get a custom bitmap, use the default
  245. if (!fCustomBmpUsed)
  246. {
  247. *pidRes = idDefault;
  248. *phMod = hDllInstance;
  249. }
  250. return fCustomBmpUsed;
  251. }
  252. void LoadBranding(BOOL fDeepImages, BOOL* pfTextOnLarge, BOOL* pfTextOnSmall)
  253. {
  254. HINSTANCE hResourceDll;
  255. UINT idBitmap;
  256. LPTSTR pszRegkeyLeafLogonBmp;
  257. LPTSTR pszRegkeyLeafOtherDlgBmp;
  258. UINT idDefaultSmall;
  259. UINT idDefaultLarge;
  260. BOOL fWinBrandDll = FALSE;
  261. HINSTANCE hWinBrandDll = NULL;
  262. pszRegkeyLeafOtherDlgBmp = fDeepImages ? REGSTR_OTHERDLG_8BIT : REGSTR_OTHERDLG_4BIT;
  263. pszRegkeyLeafLogonBmp = fDeepImages ? REGSTR_LOGON_8BIT : REGSTR_LOGON_4BIT;
  264. if (IsOS(OS_APPLIANCE))
  265. {
  266. fWinBrandDll = TRUE;
  267. idDefaultSmall = fDeepImages ? IDB_SMALL_SRVAPP_8_MSGINA_DLL : IDB_SMALL_SRVAPP_4_MSGINA_DLL;
  268. idDefaultLarge = fDeepImages ? IDB_MEDIUM_SRVAPP_8_MSGINA_DLL : IDB_MEDIUM_SRVAPP_4_MSGINA_DLL;
  269. }
  270. else if (IsOS(OS_DATACENTER))
  271. {
  272. idDefaultSmall = fDeepImages ? IDB_SMALL_DCS_8 : IDB_SMALL_DCS_4;
  273. idDefaultLarge = fDeepImages ? IDB_MEDIUM_DCS_8 : IDB_MEDIUM_DCS_4;
  274. }
  275. else if (IsOS(OS_ADVSERVER))
  276. {
  277. idDefaultSmall = fDeepImages ? IDB_SMALL_ADV_8 : IDB_SMALL_ADV_4;
  278. idDefaultLarge = fDeepImages ? IDB_MEDIUM_ADV_8 : IDB_MEDIUM_ADV_4;
  279. }
  280. else if (IsOS(OS_SMALLBUSINESSSERVER))
  281. {
  282. idDefaultSmall = fDeepImages ? IDB_SMALL_SBS_8 : IDB_SMALL_SBS_4;
  283. idDefaultLarge = fDeepImages ? IDB_MEDIUM_SBS_8 : IDB_MEDIUM_SBS_4;
  284. }
  285. else if (IsOS(OS_BLADE))
  286. {
  287. idDefaultSmall = fDeepImages ? IDB_SMALL_BLA_8 : IDB_SMALL_BLA_4;
  288. idDefaultLarge = fDeepImages ? IDB_MEDIUM_BLA_8 : IDB_MEDIUM_BLA_4;
  289. }
  290. else if (IsOS(OS_SERVER))
  291. {
  292. idDefaultSmall = fDeepImages ? IDB_SMALL_SRV_8 : IDB_SMALL_SRV_4;
  293. idDefaultLarge = fDeepImages ? IDB_MEDIUM_SRV_8 : IDB_MEDIUM_SRV_4;
  294. }
  295. else if (IsOS(OS_PERSONAL))
  296. {
  297. idDefaultSmall = fDeepImages ? IDB_SMALL_PER_8 : IDB_SMALL_PER_4;
  298. idDefaultLarge = fDeepImages ? IDB_MEDIUM_PER_8 : IDB_MEDIUM_PER_4;
  299. }
  300. else
  301. {
  302. if (IsOS(OS_EMBEDDED))
  303. {
  304. idDefaultSmall = fDeepImages ? IDB_SMALL_PROEMB_8 : IDB_SMALL_PROEMB_4;
  305. idDefaultLarge = fDeepImages ? IDB_MEDIUM_PROEMB_8 : IDB_MEDIUM_PROEMB_4;
  306. }
  307. else if (IsOS(OS_TABLETPC))
  308. {
  309. fWinBrandDll = TRUE;
  310. idDefaultSmall = fDeepImages ? IDB_SMALL_PROTAB_8_MSGINA_DLL : IDB_SMALL_PROTAB_4_MSGINA_DLL;
  311. idDefaultLarge = fDeepImages ? IDB_MEDIUM_PROTAB_8_MSGINA_DLL : IDB_MEDIUM_PROTAB_4_MSGINA_DLL;
  312. }
  313. else if (IsOS(OS_MEDIACENTER))
  314. {
  315. fWinBrandDll = TRUE;
  316. idDefaultSmall = fDeepImages ? IDB_SMALL_PROMED_8_MSGINA_DLL : IDB_SMALL_PROMED_4_MSGINA_DLL;
  317. idDefaultLarge = fDeepImages ? IDB_MEDIUM_PROMED_8_MSGINA_DLL : IDB_MEDIUM_PROMED_4_MSGINA_DLL;
  318. }
  319. else
  320. {
  321. idDefaultSmall = fDeepImages ? IDB_SMALL_PRO_8 : IDB_SMALL_PRO_4;
  322. idDefaultLarge = fDeepImages ? IDB_MEDIUM_PRO_8 : IDB_MEDIUM_PRO_4;
  323. }
  324. }
  325. //
  326. // If this is a resource in the special Windows branding resource DLL,
  327. // attempt to load the DLL. If this fails, just default to the
  328. // Professional bitmaps.
  329. //
  330. if (fWinBrandDll)
  331. {
  332. hWinBrandDll = LoadLibraryEx(TEXT("winbrand.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE);
  333. if (hWinBrandDll == NULL)
  334. {
  335. idDefaultSmall = fDeepImages ? IDB_SMALL_PRO_8 : IDB_SMALL_PRO_4;
  336. idDefaultLarge = fDeepImages ? IDB_MEDIUM_PRO_8 : IDB_MEDIUM_PRO_4;
  337. }
  338. }
  339. // Load the bitmap
  340. GetBrandingModuleAndResid(REGSTR_CUSTOM_BRAND, pszRegkeyLeafOtherDlgBmp, idDefaultSmall,
  341. &hResourceDll, &idBitmap, pfTextOnSmall);
  342. if ((hResourceDll == hDllInstance) && (hWinBrandDll != NULL))
  343. {
  344. hResourceDll = hWinBrandDll;
  345. }
  346. if (g_hbmOtherDlgBrand != NULL)
  347. {
  348. DeleteObject(g_hbmOtherDlgBrand);
  349. g_hbmOtherDlgBrand = NULL;
  350. }
  351. g_hbmOtherDlgBrand = LoadBitmapGetSize(hResourceDll, idBitmap, &g_sizeOtherDlgBrand);
  352. //
  353. // If this is the special Windows branding resource DLL, don't free it
  354. // just yet; we probably need it for the default large bitmap also.
  355. //
  356. if ((hResourceDll != hDllInstance) && (hResourceDll != hWinBrandDll))
  357. {
  358. FreeLibrary(hResourceDll);
  359. }
  360. GetBrandingModuleAndResid(REGSTR_CUSTOM_BRAND, pszRegkeyLeafLogonBmp, idDefaultLarge,
  361. &hResourceDll, &idBitmap, pfTextOnLarge);
  362. if ((hResourceDll == hDllInstance) && (hWinBrandDll != NULL))
  363. {
  364. hResourceDll = hWinBrandDll;
  365. }
  366. if (g_hbmLogonBrand != NULL)
  367. {
  368. DeleteObject(g_hbmLogonBrand);
  369. g_hbmLogonBrand = NULL;
  370. }
  371. g_hbmLogonBrand = LoadBitmapGetSize(hResourceDll, idBitmap, &g_sizeLogonBrand);
  372. //
  373. // If this is the special Windows branding resource DLL, or a normal custom
  374. // bitmap DLL, free it now.
  375. //
  376. if ((hResourceDll != hDllInstance) && (hResourceDll != hWinBrandDll))
  377. {
  378. FreeLibrary(hResourceDll);
  379. }
  380. //
  381. // If the special windows branding resource DLL was loaded, free it now.
  382. //
  383. if (hWinBrandDll != NULL)
  384. {
  385. FreeLibrary(hWinBrandDll);
  386. }
  387. }
  388. void LoadBand(BOOL fDeepImages)
  389. {
  390. HINSTANCE hResourceDll;
  391. UINT idBitmap;
  392. BOOL fPaintText; // Ignored
  393. // Workstation bitmap load - see if we have custom bmp
  394. GetBrandingModuleAndResid(REGSTR_CUSTOM_BRAND,
  395. fDeepImages ? REGSTR_BAND_8BIT : REGSTR_BAND_4BIT,
  396. fDeepImages ? IDB_BAND_8 : IDB_BAND_4, &hResourceDll, &idBitmap, &fPaintText);
  397. if (g_hbmBand != NULL)
  398. {
  399. DeleteObject(g_hbmBand);
  400. g_hbmBand = NULL;
  401. }
  402. g_hbmBand = LoadBitmapGetSize(hResourceDll, idBitmap, &g_sizeBand);
  403. if (hResourceDll != hDllInstance)
  404. {
  405. FreeLibrary(hResourceDll);
  406. }
  407. }
  408. VOID CreateBorderBrushes(HDC hdc, HBITMAP hbm, SIZE* psize, HBRUSH* phbr)
  409. {
  410. COLORREF crLeft;
  411. COLORREF crRight;
  412. //
  413. // Delete any existing brushes.
  414. //
  415. if (phbr[0] != NULL)
  416. {
  417. //
  418. // If we created a separate brush for the right, delete it.
  419. //
  420. if (phbr[1] != phbr[0])
  421. {
  422. DeleteObject(phbr[1]);
  423. }
  424. phbr[1] = NULL;
  425. DeleteObject(phbr[0]);
  426. phbr[0] = NULL;
  427. }
  428. //
  429. // Create brushes for filling the border when the dialog box is wider than
  430. // the branding bitmap. First create a brush matching the upper left pixel
  431. // of the bitmap. Next, create one for the upper right, if different.
  432. //
  433. if (SelectObject(hdc, hbm) != NULL)
  434. {
  435. crLeft = GetPixel(hdc, 0, 0);
  436. if (crLeft != CLR_INVALID)
  437. {
  438. phbr[0] = CreateSolidBrush(crLeft);
  439. if (phbr[0] != NULL)
  440. {
  441. crRight = GetPixel(hdc, psize->cx - 1, 0);
  442. if ((crRight != CLR_INVALID) && (crRight != crLeft))
  443. {
  444. phbr[1] = CreateSolidBrush(crRight);
  445. }
  446. }
  447. }
  448. }
  449. if (phbr[0] == NULL)
  450. {
  451. phbr[0] = GetStockObject(WHITE_BRUSH);
  452. }
  453. //
  454. // If we don't have a separate brush for the right border, just use the
  455. // same brush as for the left border.
  456. //
  457. if (phbr[1] == NULL)
  458. {
  459. phbr[1] = phbr[0];
  460. }
  461. }
  462. VOID ReLoadBrandingImages(
  463. BOOL fDeepImages,
  464. BOOL* pfTextOnLarge,
  465. BOOL* pfTextOnSmall)
  466. {
  467. HDC hDC;
  468. RGBQUAD rgb[256];
  469. LPLOGPALETTE pLogPalette;
  470. INT i;
  471. BOOL fTextOnLarge;
  472. BOOL fTextOnSmall;
  473. hDC = CreateCompatibleDC(NULL);
  474. if ( !hDC )
  475. return;
  476. //
  477. // Load the resources we need
  478. //
  479. LoadBranding(
  480. fDeepImages,
  481. (pfTextOnLarge == NULL) ? &fTextOnLarge : pfTextOnLarge,
  482. (pfTextOnSmall == NULL) ? &fTextOnSmall : pfTextOnSmall);
  483. LoadBand(fDeepImages);
  484. //
  485. // if we loaded the deep images then take the palette from the 'animated band' bitmap
  486. // and use that as the one for all the images we are creating.
  487. //
  488. if (g_hpalBranding != NULL)
  489. {
  490. DeleteObject(g_hpalBranding);
  491. g_hpalBranding = NULL;
  492. }
  493. if ( fDeepImages )
  494. {
  495. SelectObject(hDC, g_hbmBand);
  496. GetDIBColorTable(hDC, 0, 256, rgb);
  497. pLogPalette = (LPLOGPALETTE)LocalAlloc(LPTR, sizeof(LOGPALETTE)*(sizeof(PALETTEENTRY)*256));
  498. if ( pLogPalette )
  499. {
  500. pLogPalette->palVersion = 0x0300;
  501. pLogPalette->palNumEntries = 256;
  502. for ( i = 0 ; i < 256 ; i++ )
  503. {
  504. pLogPalette->palPalEntry[i].peRed = rgb[i].rgbRed;
  505. pLogPalette->palPalEntry[i].peGreen = rgb[i].rgbGreen;
  506. pLogPalette->palPalEntry[i].peBlue = rgb[i].rgbBlue;
  507. //pLogPalette->palPalEntry[i].peFlags = 0;
  508. }
  509. g_hpalBranding = CreatePalette(pLogPalette);
  510. LocalFree(pLogPalette);
  511. }
  512. }
  513. CreateBorderBrushes(hDC, g_hbmLogonBrand, &g_sizeLogonBrand, g_hbrLogonBrand);
  514. CreateBorderBrushes(hDC, g_hbmOtherDlgBrand, &g_sizeOtherDlgBrand, g_hbrOtherDlgBrand);
  515. DeleteDC(hDC);
  516. }
  517. BOOL DeepImages(BOOL fNoPaletteChanges)
  518. {
  519. BOOL fDeepImages = FALSE;
  520. HDC hDC;
  521. INT nDeviceBits;
  522. //
  523. // Should we load the "nice" 8 bit per pixel images, or the low res
  524. // 4 bit versions.
  525. //
  526. hDC = CreateCompatibleDC(NULL);
  527. if ( !hDC )
  528. return(FALSE);
  529. nDeviceBits = GetDeviceCaps(hDC, BITSPIXEL);
  530. if (nDeviceBits > 8)
  531. {
  532. fDeepImages = TRUE;
  533. }
  534. // If the caller doesn't want to deal with 256-color palette
  535. // changes, give them 4-bit images.
  536. if (fNoPaletteChanges && (nDeviceBits == 8))
  537. {
  538. fDeepImages = FALSE;
  539. }
  540. DeleteDC(hDC);
  541. return(fDeepImages);
  542. }
  543. VOID LoadBrandingImages(BOOL fNoPaletteChanges,
  544. BOOL* pfTextOnLarge, BOOL* pfTextOnSmall)
  545. {
  546. BOOL fDeepImages;
  547. fDeepImages = DeepImages(fNoPaletteChanges);
  548. ReLoadBrandingImages(fDeepImages, pfTextOnLarge, pfTextOnSmall);
  549. g_fDeepImages = fDeepImages;
  550. g_fNoPalleteChanges = fNoPaletteChanges;
  551. }
  552. /*-----------------------------------------------------------------------------
  553. / SizeForBranding
  554. / ---------------
  555. / Adjust the size of the dialog to allow for branding.
  556. /
  557. / In:
  558. / hWnd = size the window to account for the branding images we are going to
  559. / add to it.
  560. /
  561. / Out:
  562. / -
  563. /----------------------------------------------------------------------------*/
  564. VOID SizeForBranding(HWND hWnd, BOOL fLargeBrand)
  565. {
  566. //
  567. // All windows have two branding imges, the banner and the band.
  568. // therefore lets adjust for those.
  569. //
  570. if (fLargeBrand)
  571. {
  572. MoveChildren(hWnd, 0, g_sizeLogonBrand.cy);
  573. }
  574. else
  575. {
  576. MoveChildren(hWnd, 0, g_sizeOtherDlgBrand.cy);
  577. }
  578. MoveChildren(hWnd, 0, g_sizeBand.cy);
  579. }
  580. /*-----------------------------------------------------------------------------
  581. / PaintFullBranding
  582. / -------------
  583. / Paints the full branding, which includes the copyright notice and
  584. / "Build on NT" into the given DC. So here we must realize the palette
  585. / we want to show and then paint the images. If fBandOnly is TRUE
  586. / then we only paint the band. This is used by the animation code.
  587. /
  588. / In:
  589. / hDC = DC to paint into
  590. / fBandOnly = paint the band only
  591. / nBackground = the system color index for the bkgnd.
  592. /
  593. / Out:
  594. / -
  595. / dsheldon copied from PaintBranding and modified 11/16/98
  596. /----------------------------------------------------------------------------*/
  597. BOOL PaintBranding(HWND hWnd, HDC hDC, INT bandOffset, BOOL fBandOnly, BOOL fLargeBrand, int nBackground)
  598. {
  599. HDC hdcBitmap;
  600. HPALETTE oldPalette = NULL;
  601. HBITMAP oldBitmap;
  602. RECT rc = { 0 };
  603. INT cxRect, cxBand;
  604. SIZE* psizeBrand;
  605. HBITMAP* phbmBrand;
  606. HBRUSH *phbrBackground;
  607. BOOL fTemp;
  608. fTemp = DeepImages(g_fNoPalleteChanges);
  609. if (g_fDeepImages != fTemp)
  610. {
  611. g_fDeepImages = fTemp;
  612. ReLoadBrandingImages(fTemp, NULL, NULL);
  613. }
  614. // See if we're working with the large or small branding
  615. if (fLargeBrand)
  616. {
  617. psizeBrand = &g_sizeLogonBrand;
  618. phbmBrand = &g_hbmLogonBrand;
  619. phbrBackground = g_hbrLogonBrand;
  620. }
  621. else
  622. {
  623. psizeBrand = &g_sizeOtherDlgBrand;
  624. phbmBrand = &g_hbmOtherDlgBrand;
  625. phbrBackground = g_hbrOtherDlgBrand;
  626. }
  627. hdcBitmap = CreateCompatibleDC(hDC);
  628. if ( !hdcBitmap )
  629. return FALSE;
  630. GetClientRect(hWnd, &rc);
  631. if ( g_hpalBranding )
  632. oldPalette = SelectPalette(hDC, g_hpalBranding, FALSE);
  633. //
  634. // paint the band at its animation point (bandOffset)
  635. //
  636. oldBitmap = (HBITMAP)SelectObject(hdcBitmap, g_hbmBand);
  637. cxRect = rc.right-rc.left;
  638. cxBand = min(g_sizeBand.cx, cxRect);
  639. StretchBlt(hDC,
  640. bandOffset, psizeBrand->cy,
  641. cxRect, g_sizeBand.cy,
  642. hdcBitmap,
  643. (g_sizeBand.cx-cxBand)/2, 0,
  644. cxBand, g_sizeBand.cy,
  645. SRCCOPY);
  646. StretchBlt(hDC,
  647. (-cxRect)+bandOffset, psizeBrand->cy,
  648. cxRect, g_sizeBand.cy,
  649. hdcBitmap,
  650. (g_sizeBand.cx-cxBand)/2, 0,
  651. cxBand, g_sizeBand.cy,
  652. SRCCOPY);
  653. //
  654. // paint the branding clipped to the current dialog, if for some
  655. // reason the dialog is wider than the bitmap then lets
  656. // fill in with white space.
  657. //
  658. if ( !fBandOnly )
  659. {
  660. int iStretchedPixels;
  661. RECT rcBackground;
  662. SelectObject(hdcBitmap, *phbmBrand);
  663. iStretchedPixels = (cxRect - psizeBrand->cx) / 2;
  664. if (iStretchedPixels < 0)
  665. {
  666. iStretchedPixels = 0;
  667. }
  668. BitBlt(hDC, iStretchedPixels, 0, psizeBrand->cx, psizeBrand->cy, hdcBitmap, 0, 0, SRCCOPY);
  669. if (iStretchedPixels != 0)
  670. {
  671. SetRect(&rcBackground, 0, 0, iStretchedPixels, psizeBrand->cy);
  672. FillRect(hDC, &rcBackground, phbrBackground[0]);
  673. SetRect(&rcBackground, cxRect - iStretchedPixels - 1, 0, cxRect, psizeBrand->cy);
  674. FillRect(hDC, &rcBackground, phbrBackground[1]);
  675. }
  676. rc.top = psizeBrand->cy + g_sizeBand.cy;
  677. FillRect(hDC, &rc, (HBRUSH)IntToPtr(1+nBackground));
  678. }
  679. if ( oldBitmap )
  680. SelectObject(hdcBitmap, oldBitmap);
  681. if ( oldPalette )
  682. SelectPalette(hDC, oldPalette, TRUE);
  683. DeleteDC(hdcBitmap);
  684. return TRUE;
  685. }
  686. /*-----------------------------------------------------------------------------
  687. / BrandingQueryNewPalette / BrandingPaletteChanged
  688. / ------------------------------------------------
  689. / Handle palette change messages from the system so that we can work correctly
  690. / on <= 8 bit per pixel devices.
  691. /
  692. / In:
  693. / -
  694. / Out:
  695. / -
  696. /----------------------------------------------------------------------------*/
  697. BOOL BrandingQueryNewPalete(HWND hDlg)
  698. {
  699. HDC hDC;
  700. HPALETTE oldPalette;
  701. if ( !g_hpalBranding )
  702. return FALSE;
  703. hDC = GetDC(hDlg);
  704. if ( !hDC )
  705. return FALSE;
  706. oldPalette = SelectPalette(hDC, g_hpalBranding, FALSE);
  707. RealizePalette(hDC);
  708. UpdateColors(hDC);
  709. InvalidateRect(hDlg, NULL, TRUE);
  710. UpdateWindow(hDlg);
  711. if ( oldPalette )
  712. SelectPalette(hDC, oldPalette, FALSE);
  713. ReleaseDC(hDlg, hDC);
  714. return TRUE;
  715. }
  716. BOOL BrandingPaletteChanged(HWND hDlg, HWND hWndPalChg)
  717. {
  718. HDC hDC;
  719. HPALETTE oldPalette;
  720. if ( !g_hpalBranding )
  721. return FALSE;
  722. if ( hDlg != hWndPalChg )
  723. {
  724. hDC = GetDC(hDlg);
  725. if ( !hDC )
  726. return FALSE;
  727. oldPalette = SelectPalette(hDC, g_hpalBranding, FALSE);
  728. RealizePalette(hDC);
  729. UpdateColors(hDC);
  730. if ( oldPalette )
  731. SelectPalette(hDC, oldPalette, FALSE);
  732. ReleaseDC(hDlg, hDC);
  733. }
  734. return FALSE;
  735. }
  736. // DrawTextAutoSize helper function:
  737. /***************************************************************************\
  738. * FUNCTION: DrawTextAutoSize
  739. *
  740. * PURPOSE: Takes the same parameters and returns the same values as DrawText.
  741. * This function adjusts the bottom of the passed in rectangle as
  742. * necessary to fit all of the text.
  743. *
  744. * 05-06-98 dsheldon Created.
  745. \***************************************************************************/
  746. LONG DrawTextAutoSize(HDC hdc, LPCTSTR szString, int cchString, LPRECT prc, UINT uFormat)
  747. {
  748. LONG yHeight;
  749. LONG left, right;
  750. left = prc->left;
  751. right = prc->right;
  752. yHeight = DrawText(hdc, szString, cchString, prc, uFormat | DT_CALCRECT);
  753. if (yHeight != 0)
  754. {
  755. prc->left = left;
  756. prc->right = right;
  757. yHeight = DrawText(hdc, szString, cchString, prc, uFormat & (~DT_CALCRECT));
  758. }
  759. return yHeight;
  760. }
  761. /***************************************************************************\
  762. * FUNCTION: MarkupTextOut
  763. *
  764. * PURPOSE: Paints a line of marked-up text (with bolding, etc)
  765. *
  766. * IN: hdc, x, y, text, flags (none so far)
  767. *
  768. * RETURNS: FALSE == failure
  769. *
  770. * HISTORY:
  771. *
  772. * 11-10-98 dsheldon Created.
  773. *
  774. \***************************************************************************/
  775. BOOL MarkupTextOut(HDC hdc, int x, int y, LPWSTR szText, DWORD dwFlags)
  776. {
  777. BOOL fSuccess = FALSE;
  778. HFONT hBoldFont = NULL;
  779. HFONT hNormalFont = NULL;
  780. // Get the normal and bold font
  781. hNormalFont = GetCurrentObject(hdc, OBJ_FONT);
  782. if (NULL != hNormalFont)
  783. {
  784. LOGFONT lf = {0};
  785. GetObject(hNormalFont, sizeof(lf), (LPVOID) &lf);
  786. lf.lfWeight = 1000;
  787. hBoldFont = CreateFontIndirect(&lf);
  788. }
  789. if ((NULL != hNormalFont) || (NULL != hBoldFont))
  790. {
  791. BOOL fLoop;
  792. WCHAR* pszStringPart;
  793. WCHAR* pszExamine;
  794. int cchStringPart;
  795. BOOL fBold;
  796. BOOL fOutputStringPart;
  797. // Reset current text point
  798. SetTextAlign(hdc, TA_UPDATECP);
  799. MoveToEx(hdc, x, y, NULL);
  800. fLoop = TRUE;
  801. pszStringPart = szText;
  802. pszExamine = szText;
  803. cchStringPart = 0;
  804. fBold = FALSE;
  805. while (fLoop)
  806. {
  807. // Assume we'll find the end of the current string part
  808. fOutputStringPart = TRUE;
  809. // See how long the current string part is; a '\0' or a
  810. // 'bold tag' may end the current string part
  811. if (L'\0' == *pszExamine)
  812. {
  813. // String is done; loop is over
  814. fLoop = FALSE;
  815. fSuccess = TRUE;
  816. }
  817. // See if this is a bold tag or an end bold tag
  818. else if (0 == _wcsnicmp(pszExamine, L"<B>", 3))
  819. {
  820. fBold = TRUE;
  821. pszExamine += 3;
  822. }
  823. else if (0 == _wcsnicmp(pszExamine, L"</B>", 4))
  824. {
  825. fBold = FALSE;
  826. pszExamine += 4;
  827. }
  828. // TODO: Look for other tags here if needed
  829. else
  830. {
  831. // No tag (same String Part)
  832. cchStringPart ++;
  833. pszExamine ++;
  834. fOutputStringPart = FALSE;
  835. }
  836. if (fOutputStringPart)
  837. {
  838. TextOut(hdc, 0, 0, pszStringPart, cchStringPart);
  839. // Next string part
  840. pszStringPart = pszExamine;
  841. cchStringPart = 0;
  842. if (fBold)
  843. {
  844. SelectObject(hdc, hBoldFont);
  845. }
  846. else
  847. {
  848. SelectObject(hdc, hNormalFont);
  849. }
  850. } //if
  851. } //while
  852. } //if
  853. SelectObject(hdc, hNormalFont);
  854. SetTextAlign(hdc, TA_NOUPDATECP);
  855. // Clean up bold font if necessary
  856. if (NULL != hBoldFont)
  857. {
  858. DeleteObject(hBoldFont);
  859. }
  860. return fSuccess;
  861. }
  862. /***************************************************************************\
  863. * FUNCTION: PaintBitmapText
  864. *
  865. * PURPOSE: Paints the copyright notice and release/version text on the
  866. * Splash and Logon bitmaps
  867. *
  868. * IN: pGinaFonts - Uses the font handles in this structure
  869. * Also uses global bitmap handles
  870. *
  871. * RETURNS: void; modifies global bitmaps
  872. *
  873. * HISTORY:
  874. *
  875. * 05-06-98 dsheldon Created.
  876. *
  877. \***************************************************************************/
  878. VOID PaintBitmapText(PGINAFONTS pGinaFonts, BOOL fTextOnLarge,
  879. BOOL fTextOnSmall)
  880. {
  881. // Various metrics used to draw the text
  882. // Horizontal Positioning of copyright
  883. static const int CopyrightRightMargin = 9;
  884. static const int CopyrightWidth = 134;
  885. // Vertical positioning of copyright
  886. static const int CopyrightTop = 21;
  887. // Vertical for the logon window Beta3 message
  888. static const int BetaTopNormal = 28;
  889. // Horizontal
  890. static const int BetaRightMargin = 13;
  891. static const int BetaWidth = 100;
  892. // If we're showing the copyright, draw the "beta3" here
  893. static const int BetaTopCopyright = 53;
  894. // Positioning of "Built on NT"
  895. static const int BuiltOnNtTop = 68;
  896. static const int BuiltOnNtTopTerminal = 91;
  897. static const int BuiltOnNtLeft = 186;
  898. HDC hdcBitmap;
  899. HBITMAP hbmOld;
  900. HFONT hfontOld;
  901. NT_PRODUCT_TYPE NtProductType;
  902. TCHAR szCopyright[128];
  903. TCHAR szBuiltOnNt[256];
  904. TCHAR szRelease[64];
  905. // Used for calculating text drawing areas
  906. RECT rc;
  907. BOOL fTemp;
  908. szCopyright[0] = 0;
  909. szBuiltOnNt[0] = 0;
  910. szRelease[0] = 0;
  911. // Get the product type
  912. RtlGetNtProductType(&NtProductType);
  913. // Load the strings that will be painted on the bitmaps
  914. LoadString(hDllInstance, IDS_RELEASE_TEXT, szRelease, ARRAYSIZE(szRelease));
  915. LoadString(hDllInstance, IDS_COPYRIGHT_TEXT, szCopyright, ARRAYSIZE(szCopyright));
  916. LoadString(hDllInstance, IDS_BUILTONNT_TEXT, szBuiltOnNt, ARRAYSIZE(szBuiltOnNt));
  917. fTemp = DeepImages(g_fNoPalleteChanges);
  918. if (g_fDeepImages != fTemp)
  919. {
  920. g_fDeepImages = fTemp;
  921. ReLoadBrandingImages(fTemp, NULL, NULL);
  922. }
  923. // Create a compatible DC for painting the copyright and release/version notices
  924. hdcBitmap = CreateCompatibleDC(NULL);
  925. if (hdcBitmap)
  926. {
  927. // Set text transparency and color (black)
  928. SetTextColor(hdcBitmap, RGB(0,0,0));
  929. SetBkMode(hdcBitmap, TRANSPARENT);
  930. SetMapMode(hdcBitmap, MM_TEXT);
  931. // Work with the splash bitmap
  932. if (fTextOnLarge && g_hbmLogonBrand)
  933. {
  934. hbmOld = SelectObject(hdcBitmap, g_hbmLogonBrand);
  935. hfontOld = SelectObject(hdcBitmap, pGinaFonts->hCopyrightFont);
  936. if (GetSystemMetrics(SM_REMOTESESSION))
  937. {
  938. // paint the copyright notice for remote sessions
  939. TEXTMETRIC textMetric;
  940. (BOOL)GetTextMetrics(hdcBitmap, &textMetric);
  941. rc.top = g_sizeLogonBrand.cy - textMetric.tmHeight;
  942. rc.bottom = g_sizeLogonBrand.cy;
  943. rc.left = textMetric.tmAveCharWidth;
  944. rc.right = g_sizeLogonBrand.cx;
  945. DrawTextAutoSize(hdcBitmap, szCopyright, -1, &rc, 0);
  946. }
  947. // paint the release/version notice
  948. SelectObject(hdcBitmap, pGinaFonts->hBetaFont);
  949. rc.top = BetaTopNormal;
  950. rc.left = g_sizeLogonBrand.cx - BetaRightMargin - BetaWidth;
  951. rc.right = g_sizeLogonBrand.cx - BetaRightMargin;
  952. SetTextColor(hdcBitmap, RGB(128, 128, 128));
  953. DrawTextAutoSize(hdcBitmap, szRelease, -1, &rc, DT_RIGHT | DT_WORDBREAK);
  954. SetTextColor(hdcBitmap, RGB(0,0,0));
  955. // paint the built on NT message
  956. SelectObject(hdcBitmap, pGinaFonts->hBuiltOnNtFont);
  957. MarkupTextOut(hdcBitmap, BuiltOnNtLeft, BuiltOnNtTop, szBuiltOnNt, 0);
  958. SelectObject(hdcBitmap, hfontOld);
  959. SelectObject(hdcBitmap, hbmOld);
  960. }
  961. if (fTextOnSmall && g_hbmOtherDlgBrand)
  962. {
  963. hbmOld = SelectObject(hdcBitmap, g_hbmOtherDlgBrand);
  964. // paint the release notice
  965. hfontOld = SelectObject(hdcBitmap, pGinaFonts->hBetaFont);
  966. rc.top = BetaTopNormal;
  967. rc.left = g_sizeOtherDlgBrand.cx - BetaRightMargin - BetaWidth;
  968. rc.right = g_sizeOtherDlgBrand.cx - BetaRightMargin;
  969. SetTextColor(hdcBitmap, RGB(128, 128, 128));
  970. DrawTextAutoSize(hdcBitmap, szRelease, -1, &rc, DT_RIGHT | DT_WORDBREAK);
  971. SetTextColor(hdcBitmap, RGB(0, 0, 0));
  972. SelectObject(hdcBitmap, hfontOld);
  973. SelectObject(hdcBitmap, hbmOld);
  974. }
  975. DeleteDC(hdcBitmap);
  976. }
  977. }
  978. // Two helpers for CreateFonts
  979. void SetFontFaceFromResource(PLOGFONT plf, UINT idFaceName)
  980. // Sets the font face from a specified resource, or uses a default if string load fails
  981. {
  982. // Read the face name and point size from the resource file
  983. if (LoadString(hDllInstance, idFaceName, plf->lfFaceName, LF_FACESIZE) == 0)
  984. {
  985. lstrcpy(plf->lfFaceName, TEXT("Tahoma"));
  986. OutputDebugString(TEXT("Could not read welcome font face from resource"));
  987. }
  988. }
  989. void SetFontSizeFromResource(PLOGFONT plf, UINT idSizeName)
  990. // Sets the font size from a resource, or uses a default if the string load fails.
  991. // Now uses pixel height instead of point size
  992. {
  993. TCHAR szPixelSize[10];
  994. LONG nSize;
  995. HDC hdcScreen;
  996. if (LoadString(hDllInstance, idSizeName, szPixelSize, ARRAYSIZE(szPixelSize)) != 0)
  997. {
  998. nSize = _ttol(szPixelSize);
  999. }
  1000. else
  1001. {
  1002. // Make it really obvious something is wrong
  1003. nSize = 40;
  1004. }
  1005. plf->lfHeight = -nSize;
  1006. #if (1) //DSIE: Bug 262839
  1007. if (hdcScreen = GetDC(NULL))
  1008. {
  1009. double dScaleY = GetDeviceCaps(hdcScreen, LOGPIXELSY) / 96.0f;
  1010. plf->lfHeight = (int) (plf->lfHeight * dScaleY); // Scale the height based on the system DPI.
  1011. ReleaseDC(NULL, hdcScreen);
  1012. }
  1013. #endif
  1014. }
  1015. /***************************************************************************\
  1016. * FUNCTION: CreateFonts
  1017. *
  1018. * PURPOSE: Creates the fonts for the welcome and logon screens
  1019. *
  1020. * IN/OUT: pGinaFonts - Sets the font handles in this structure
  1021. *
  1022. * RETURNS: void; also see IN/OUT above
  1023. *
  1024. * HISTORY:
  1025. *
  1026. * 05-05-98 dsheldon Created.
  1027. *
  1028. \***************************************************************************/
  1029. void CreateFonts(PGINAFONTS pGinaFonts)
  1030. {
  1031. LOGFONT lf = {0};
  1032. CHARSETINFO csInfo;
  1033. WCHAR szFontName[32];
  1034. lf.lfWidth = 0;
  1035. lf.lfWeight = FW_NORMAL;
  1036. lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
  1037. lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
  1038. lf.lfQuality = DEFAULT_QUALITY;
  1039. lf.lfPitchAndFamily = DEFAULT_PITCH;
  1040. // Set charset
  1041. if (TranslateCharsetInfo((DWORD*)IntToPtr(GetACP()), &csInfo,
  1042. TCI_SRCCODEPAGE) == 0)
  1043. {
  1044. csInfo.ciCharset = 0;
  1045. }
  1046. lf.lfCharSet = (UCHAR)csInfo.ciCharset;
  1047. if (pGinaFonts->hWelcomeFont == NULL)
  1048. {
  1049. // Create the welcome font
  1050. SetFontFaceFromResource(&lf, IDS_PRESSCAD_FACENAME);
  1051. SetFontSizeFromResource(&lf, IDS_PRESSCAD_FACESIZE);
  1052. // make sure font is loaded before calling CreateFontIndirect
  1053. if (LoadString(hDllInstance, IDS_PRESSCAD_FONTNAME, szFontName, 32) == 0)
  1054. {
  1055. AddFontResource(L"Tahoma.ttf");
  1056. }
  1057. else
  1058. {
  1059. AddFontResource(szFontName);
  1060. }
  1061. pGinaFonts->hWelcomeFont = CreateFontIndirect(&lf);
  1062. }
  1063. if (pGinaFonts->hBetaFont == NULL)
  1064. {
  1065. // Create the release font for the welcome page
  1066. SetFontFaceFromResource(&lf, IDS_RELEASE_FACENAME);
  1067. SetFontSizeFromResource(&lf, IDS_RELEASE_FACESIZE);
  1068. pGinaFonts->hBetaFont = CreateFontIndirect(&lf);
  1069. }
  1070. if (pGinaFonts->hCopyrightFont == NULL)
  1071. {
  1072. // Create the copyright font
  1073. SetFontFaceFromResource(&lf, IDS_COPYRIGHT_FACENAME);
  1074. SetFontSizeFromResource(&lf, IDS_COPYRIGHT_FACESIZE);
  1075. pGinaFonts->hCopyrightFont = CreateFontIndirect(&lf);
  1076. }
  1077. if (pGinaFonts->hBuiltOnNtFont == NULL)
  1078. {
  1079. // Create the "Built on NT Technology" font
  1080. SetFontFaceFromResource(&lf, IDS_BUILTONNT_FACENAME);
  1081. SetFontSizeFromResource(&lf, IDS_BUILTONNT_FACESIZE);
  1082. lf.lfWeight = FW_NORMAL;
  1083. pGinaFonts->hBuiltOnNtFont = CreateFontIndirect(&lf);
  1084. }
  1085. }