user32: Always call BeginPaint/EndPaint when handling a WM_PAINT message for the button.

Python 3.5 installer creates windows with class "Button" that have 0x000e
button style, that causes infinite painting loops and inability to draw
the installer UI.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2015-10-19 20:16:50 +08:00 committed by Alexandre Julliard
parent e79bf35933
commit 0fe60f83d2
1 changed files with 5 additions and 3 deletions

View File

@ -282,16 +282,18 @@ LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
case WM_PRINTCLIENT:
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps );
if (btnPaintFunc[btn_type])
{
PAINTSTRUCT ps;
HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps );
int nOldMode = SetBkMode( hdc, OPAQUE );
(btnPaintFunc[btn_type])( hWnd, hdc, ODA_DRAWENTIRE );
SetBkMode(hdc, nOldMode); /* reset painting mode */
if( !wParam ) EndPaint( hWnd, &ps );
}
if ( !wParam ) EndPaint( hWnd, &ps );
break;
}
case WM_KEYDOWN:
if (wParam == VK_SPACE)