Commit 2948ec6a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

user32: Button should get captured when highlighted with VK_SPACE.

parent 5e568455
...@@ -309,6 +309,7 @@ static LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg, ...@@ -309,6 +309,7 @@ static LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg,
{ {
SendMessageW( hWnd, BM_SETSTATE, TRUE, 0 ); SendMessageW( hWnd, BM_SETSTATE, TRUE, 0 );
set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED ); set_button_state( hWnd, get_button_state( hWnd ) | BUTTON_BTNPRESSED );
SetCapture( hWnd );
} }
break; break;
......
...@@ -5213,6 +5213,17 @@ static void test_button_messages(void) ...@@ -5213,6 +5213,17 @@ static void test_button_messages(void)
DWORD dlg_code; DWORD dlg_code;
HFONT zfont; 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(); subclass_button();
for (i = 0; i < sizeof(button)/sizeof(button[0]); i++) for (i = 0; i < sizeof(button)/sizeof(button[0]); i++)
......
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