Commit 09f43e04 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

user32: Separate scroll bar window checks from actual drawing.

parent cead75ad
......@@ -562,15 +562,10 @@ static void SCROLL_DoDrawScrollBar( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HI
BOOL interior, RECT *rect, INT arrowSize, INT thumbPos,
INT thumbSize, BOOL vertical )
{
SCROLLBAR_INFO *infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, TRUE );
DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
if (!(hwnd = WIN_GetFullHandle( hwnd ))) return;
SCROLLBAR_INFO *infoPtr;
if (!infoPtr ||
((nBar == SB_VERT) && !(style & WS_VSCROLL)) ||
((nBar == SB_HORZ) && !(style & WS_HSCROLL))) return;
if (!WIN_IsWindowDrawable( hwnd, FALSE )) return;
if (!(infoPtr = SCROLL_GetInternalInfo( hwnd, nBar, TRUE )))
return;
/* Draw the arrows */
......@@ -625,8 +620,19 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT bar, enum SCROLL_HITTEST hit_
{
INT arrow_size, thumb_size, thumb_pos;
BOOL vertical;
DWORD style;
RECT rect;
if (!(hwnd = WIN_GetFullHandle( hwnd )))
return;
style = GetWindowLongW( hwnd, GWL_STYLE );
if ((bar == SB_VERT && !(style & WS_VSCROLL)) || (bar == SB_HORZ && !(style & WS_HSCROLL)))
return;
if (!WIN_IsWindowDrawable( hwnd, FALSE ))
return;
SCROLL_GetScrollBarDrawInfo( hwnd, bar, tracking_info, &rect, &arrow_size, &thumb_size,
&thumb_pos, &vertical );
/* do not draw if the scrollbar rectangle is empty */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment