Author: jimtabor
Date: Tue Oct 20 01:51:16 2015
New Revision: 69624
URL:
http://svn.reactos.org/svn/reactos?rev=69624&view=rev
Log:
[User32]
- 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.
Modified:
trunk/reactos/win32ss/user/user32/controls/button.c
Modified: trunk/reactos/win32ss/user/user32/controls/button.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/contro…
==============================================================================
--- trunk/reactos/win32ss/user/user32/controls/button.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/controls/button.c [iso-8859-1] Tue Oct 20 01:51:16
2015
@@ -356,16 +356,18 @@
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 );
- }
- break;
+ }
+ if ( !wParam ) EndPaint( hWnd, &ps );
+ break;
+ }
case WM_KEYDOWN:
if (wParam == VK_SPACE)
@@ -545,7 +547,6 @@
break;
case BM_SETSTYLE:
- if ((wParam & BS_TYPEMASK) >= MAX_BTN_TYPE) break;
btn_type = wParam & BS_TYPEMASK;
style = (style & ~BS_TYPEMASK) | btn_type;
#ifdef __REACTOS__