user32: Button should get captured when highlighted with VK_SPACE.

oldstable
Nikolay Sivov 2009-03-10 07:09:35 -04:00 committed by Alexandre Julliard
parent 5e56845546
commit 2948ec6a70
2 changed files with 12 additions and 0 deletions

View File

@ -309,6 +309,7 @@ static LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg,
{
SendMessageW( hWnd, BM_SETSTATE, TRUE, 0 );
set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED );
SetCapture( hWnd );
}
break;

View File

@ -5213,6 +5213,17 @@ static void test_button_messages(void)
DWORD dlg_code;
HFONT zfont;
/* selection with VK_SPACE should capture button window */
hwnd = CreateWindowExA(0, "button", "test", BS_CHECKBOX | WS_VISIBLE | WS_POPUP,
0, 0, 50, 14, 0, 0, 0, NULL);
ok(hwnd != 0, "Failed to create button window\n");
ReleaseCapture();
SetFocus(hwnd);
SendMessageA(hwnd, WM_KEYDOWN, VK_SPACE, 0);
ok(GetCapture() == hwnd, "Should be captured on VK_SPACE WM_KEYDOWN\n");
SendMessageA(hwnd, WM_KEYUP, VK_SPACE, 0);
DestroyWindow(hwnd);
subclass_button();
for (i = 0; i < sizeof(button)/sizeof(button[0]); i++)