Author: jimtabor Date: Wed Feb 1 03:09:57 2012 New Revision: 55362
URL: http://svn.reactos.org/svn/reactos?rev=55362&view=rev Log: [User32] - Attempt to fix the font leak when switching applications. Tested with other applications other than Acrobat Reader since it crashes when installing. See bug 5314.
Modified: trunk/reactos/dll/win32/user32/controls/appswitch.c
Modified: trunk/reactos/dll/win32/user32/controls/appswitch.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/a... ============================================================================== --- trunk/reactos/dll/win32/user32/controls/appswitch.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/controls/appswitch.c [iso-8859-1] Wed Feb 1 03:09:57 2012 @@ -192,6 +192,7 @@ int i; HBRUSH hBrush; HPEN hPen; + HFONT dcFont; COLORREF cr; int nch = GetWindowTextW(windowList[selectedWindow], windowText, 1023);
@@ -230,7 +231,7 @@ DrawIcon(dialogDC, xpos, ypos, hIcon); }
- SelectObject(dialogDC, dialogFont); + dcFont = SelectObject(dialogDC, dialogFont); SetTextColor(dialogDC, GetSysColor(COLOR_BTNTEXT)); SetBkColor(dialogDC, GetSysColor(COLOR_BTNFACE));
@@ -239,6 +240,7 @@ textRC.right = totalW - 8; textRC.bottom = totalH - 8; DrawTextW(dialogDC, windowText, nch, &textRC, DT_CENTER|DT_END_ELLIPSIS); + SelectObject(dialogDC, dcFont); } EndPaint(hWnd, &paint); }