ReleaseCapture should return TRUE.

This commit is contained in:
Marcus Meissner 2005-10-03 11:06:14 +00:00 committed by Alexandre Julliard
parent 9c63540d55
commit d3463d169b
2 changed files with 19 additions and 2 deletions

View File

@ -183,7 +183,19 @@ HWND WINAPI SetCapture( HWND hwnd )
*/
BOOL WINAPI ReleaseCapture(void)
{
return (SetCapture(0) != 0);
BOOL ret;
HWND previous = 0;
SERVER_START_REQ( set_capture_window )
{
req->handle = 0;
req->flags = 0;
if ((ret = !wine_server_call_err( req ))) previous = reply->previous;
}
SERVER_END_REQ;
if (previous) SendMessageW( previous, WM_CAPTURECHANGED, 0, 0 );
return ret;
}

View File

@ -2173,6 +2173,8 @@ static void test_capture_2(void)
static void test_capture_3(HWND hwnd1, HWND hwnd2)
{
BOOL ret;
ShowWindow(hwnd1, SW_HIDE);
ShowWindow(hwnd2, SW_HIDE);
@ -2188,7 +2190,10 @@ static void test_capture_3(HWND hwnd1, HWND hwnd2)
ShowWindow(hwnd1, SW_SHOW);
check_wnd_state(hwnd1, hwnd1, hwnd1, hwnd2);
ReleaseCapture();
ret = ReleaseCapture();
ok (ret, "releasecapture did not return TRUE.\n");
ret = ReleaseCapture();
ok (ret, "releasecapture did not return TRUE after second try.\n");
}
static void test_keyboard_input(HWND hwnd)