[v2 PATCH 2/3] user32/button: Use current button font to clear during WM_SETTEXT
Nikolay Sivov
nsivov at codeweavers.com
Mon Feb 6 02:43:49 CST 2017
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
dlls/user32/button.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dlls/user32/button.c b/dlls/user32/button.c
index f85b1af3b4..48fa597b70 100644
--- a/dlls/user32/button.c
+++ b/dlls/user32/button.c
@@ -384,6 +384,7 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
btn_type == BS_USERBUTTON ||
btn_type == BS_OWNERDRAW) ?
WM_CTLCOLORBTN : WM_CTLCOLORSTATIC;
+ HFONT hPrevFont = 0, hFont;
if (!parent) parent = hWnd;
hbrush = (HBRUSH)SendMessageW(parent, message,
@@ -394,7 +395,9 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
GetClientRect(hWnd, &client);
rc = client;
+ if ((hFont = get_button_font(hWnd))) hPrevFont = SelectObject(hdc, hFont);
BUTTON_CalcLabelRect(hWnd, hdc, &rc);
+ if (hPrevFont) SelectObject(hdc, hPrevFont);
/* Clip by client rect bounds */
if (rc.right > client.right) rc.right = client.right;
if (rc.bottom > client.bottom) rc.bottom = client.bottom;
--
2.11.0
More information about the wine-patches
mailing list