- Patch by Dmitry Timoshkov : Always call BeginPaint/EndPaint when handling a WM_PAINT message for the button.
- Patch by Alex Henrie : Remove always-false condition.

svn path=/trunk/; revision=69624
This commit is contained in:
James Tabor 2015-10-20 01:51:16 +00:00
parent 0e6082f21e
commit 16f015a1bc

View file

@ -356,16 +356,18 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
case WM_PRINTCLIENT: case WM_PRINTCLIENT:
case WM_PAINT: case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps );
if (btnPaintFunc[btn_type]) if (btnPaintFunc[btn_type])
{ {
PAINTSTRUCT ps;
HDC hdc = wParam ? (HDC)wParam : BeginPaint( hWnd, &ps );
int nOldMode = SetBkMode( hdc, OPAQUE ); int nOldMode = SetBkMode( hdc, OPAQUE );
(btnPaintFunc[btn_type])( hWnd, hdc, ODA_DRAWENTIRE ); (btnPaintFunc[btn_type])( hWnd, hdc, ODA_DRAWENTIRE );
SetBkMode(hdc, nOldMode); /* reset painting mode */ SetBkMode(hdc, nOldMode); /* reset painting mode */
if( !wParam ) EndPaint( hWnd, &ps );
} }
if ( !wParam ) EndPaint( hWnd, &ps );
break; break;
}
case WM_KEYDOWN: case WM_KEYDOWN:
if (wParam == VK_SPACE) if (wParam == VK_SPACE)
@ -545,7 +547,6 @@ LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
break; break;
case BM_SETSTYLE: case BM_SETSTYLE:
if ((wParam & BS_TYPEMASK) >= MAX_BTN_TYPE) break;
btn_type = wParam & BS_TYPEMASK; btn_type = wParam & BS_TYPEMASK;
style = (style & ~BS_TYPEMASK) | btn_type; style = (style & ~BS_TYPEMASK) | btn_type;
#ifdef __REACTOS__ #ifdef __REACTOS__