From 5f2e8b7f4640874a125ba1bee09ce4b57e9bcd43 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Mon, 9 Aug 2004 22:56:58 +0000 Subject: [PATCH] Delete the about dialog font when the dialog is closed. --- dlls/shell32/shell32_main.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index a6473f1f5b1..1db7b4d8ac7 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -625,6 +625,7 @@ typedef struct LPCWSTR szApp; LPCWSTR szOtherStuff; HICON hIcon; + HFONT hFont; } ABOUT_INFO; #define IDC_STATIC_TEXT 100 @@ -634,8 +635,6 @@ typedef struct #define DROP_FIELD_TOP (-15) #define DROP_FIELD_HEIGHT 15 -static HFONT hIconTitleFont; - static BOOL __get_dropline( HWND hWnd, LPRECT lprect ) { HWND hWndCtl = GetDlgItem(hWnd, IDC_WINE_TEXT); if( hWndCtl ) @@ -755,13 +754,7 @@ INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, SetWindowTextW( GetDlgItem(hWnd, IDC_STATIC_TEXT), info->szOtherStuff ); hWndCtl = GetDlgItem(hWnd, IDC_LISTBOX); SendMessageW( hWndCtl, WM_SETREDRAW, 0, 0 ); - if (!hIconTitleFont) - { - LOGFONTW logFont; - SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 ); - hIconTitleFont = CreateFontIndirectW( &logFont ); - } - SendMessageW( hWndCtl, WM_SETFONT, (WPARAM)hIconTitleFont, 0 ); + SendMessageW( hWndCtl, WM_SETFONT, (WPARAM)info->hFont, 0 ); while (*pstr) { WCHAR name[64]; @@ -842,8 +835,10 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon ) { ABOUT_INFO info; + LOGFONTW logFont; HRSRC hRes; LPVOID template; + BOOL bRet; TRACE("\n"); @@ -854,8 +849,14 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, info.szApp = szApp; info.szOtherStuff = szOtherStuff; info.hIcon = hIcon ? hIcon : LoadIconW( 0, (LPWSTR)IDI_WINLOGO ); - return DialogBoxIndirectParamW((HINSTANCE)GetWindowLongW( hWnd, GWL_HINSTANCE ), + + SystemParametersInfoW( SPI_GETICONTITLELOGFONT, 0, &logFont, 0 ); + info.hFont = CreateFontIndirectW( &logFont ); + + bRet = DialogBoxIndirectParamW((HINSTANCE)GetWindowLongW( hWnd, GWL_HINSTANCE ), template, hWnd, AboutDlgProc, (LPARAM)&info ); + DeleteObject(info.hFont); + return bRet; } /*************************************************************************