Commit 032356ec authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

user32: Disable scroll bar control window when both buttons disabled.

parent 598e6f09
......@@ -2069,6 +2069,9 @@ BOOL WINAPI EnableScrollBar( HWND hwnd, UINT nBar, UINT flags )
if (bFineWithMe && infoPtr->flags == flags) return FALSE;
infoPtr->flags = flags;
if (nBar == SB_CTL && (flags == ESB_DISABLE_BOTH || flags == ESB_ENABLE_BOTH))
EnableWindow(hwnd, flags == ESB_ENABLE_BOTH);
SCROLL_RefreshScrollBar( hwnd, nBar, TRUE, TRUE );
return TRUE;
}
......@@ -54,15 +54,26 @@ static void scrollbar_test1(void)
ret = EnableScrollBar( hScroll, SB_CTL, ESB_DISABLE_BOTH );
ok( ret, "The scrollbar should be disabled.\n" );
todo_wine
{
ok( !IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" );
}
ok( !IsWindowEnabled( hScroll ), "The scrollbar window should be disabled.\n" );
ret = EnableScrollBar( hScroll, SB_CTL, ESB_ENABLE_BOTH );
ok( ret, "The scrollbar should be enabled.\n" );
ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
/* test buttons separately */
ret = EnableScrollBar( hScroll, SB_CTL, ESB_DISABLE_LTUP );
ok( ret, "The scrollbar LTUP button should be disabled.\n" );
ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
ret = EnableScrollBar( hScroll, SB_CTL, ESB_ENABLE_BOTH );
ok( ret, "The scrollbar should be enabled.\n" );
ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
ret = EnableScrollBar( hScroll, SB_CTL, ESB_DISABLE_RTDN );
ok( ret, "The scrollbar RTDN button should be disabled.\n" );
ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
ret = EnableScrollBar( hScroll, SB_CTL, ESB_ENABLE_BOTH );
ok( ret, "The scrollbar should be enabled.\n" );
ok( IsWindowEnabled( hScroll ), "The scrollbar window should be enabled.\n" );
}
static void scrollbar_test2(void)
......
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