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.

77 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dialogs.c
  5. Abstract:
  6. This file implements the common dialog proc and other
  7. common code used by other dialog procs. All global
  8. data used by the dialog procs lives here too.
  9. Environment:
  10. WIN32 User Mode
  11. Author:
  12. Wesley Witt (wesw) 17-Feb-1996
  13. --*/
  14. #include "faxocm.h"
  15. #pragma hdrstop
  16. INT_PTR
  17. FinalDlgProc(
  18. HWND hDlg,
  19. UINT msg,
  20. WPARAM wParam,
  21. LPARAM lParam
  22. )
  23. {
  24. static HFONT hfontTextBold = NULL;
  25. static HFONT hfontTextBigBold = NULL;
  26. switch( msg ) {
  27. case WM_INITDIALOG:
  28. {
  29. SetWindowText( GetParent(hDlg), GetProductName() );
  30. CenterWindow( GetParent(hDlg), GetDesktopWindow() );
  31. LOGFONT LogFont, LogFontOriginal;
  32. HFONT hfont = (HFONT)SendMessage(GetDlgItem(hDlg, IDC_FINAL_TITLE), WM_GETFONT, 0, 0);
  33. GetObject( hfont, sizeof(LogFont), &LogFont );
  34. LogFontOriginal = LogFont;
  35. LogFont = LogFontOriginal;
  36. LogFont.lfWeight = FW_BOLD;
  37. hfontTextBold = CreateFontIndirect( &LogFont );
  38. LogFont = LogFontOriginal;
  39. LogFont.lfWeight = FW_BOLD;
  40. int PtsPixels = GetDeviceCaps( GetDC(hDlg), LOGPIXELSY );
  41. int FontSize = (LogFont.lfHeight*72/PtsPixels) * 2;
  42. LogFont.lfHeight = PtsPixels*FontSize/72;
  43. hfontTextBigBold = CreateFontIndirect( &LogFont );
  44. SetWindowFont( GetDlgItem(hDlg, IDC_FINAL_TITLE), hfontTextBold, TRUE );
  45. SetWindowFont( GetDlgItem(hDlg, IDC_FINAL_SUBTITLE), hfontTextBigBold, TRUE );
  46. }
  47. break;
  48. case WM_DESTROY:
  49. DeleteObject( hfontTextBold );
  50. DeleteObject( hfontTextBigBold );
  51. break;
  52. default:
  53. break;
  54. }
  55. return FALSE;
  56. }