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

This commit is contained in:
Nikolay Sivov 2009-03-04 17:38:41 -05:00 committed by Alexandre Julliard
parent 598e6f09c8
commit 032356ec37
2 changed files with 18 additions and 4 deletions

View File

@ -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;
}

View File

@ -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)