strmbase: Properly implement IVideoWindow::get_WindowState().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-10-08 20:02:20 -05:00 committed by Alexandre Julliard
parent ab98626afa
commit a3d3b399ff
2 changed files with 21 additions and 14 deletions

View File

@ -1487,7 +1487,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == SW_HIDE, "Got state %d.\n", state);
ok(state == SW_HIDE, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state);
ok(state == OAFALSE, "Got state %d.\n", state);
@ -1501,7 +1501,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == SW_SHOW, "Got state %d.\n", state);
ok(state == SW_SHOW, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state);
ok(state == OATRUE, "Got state %d.\n", state);
@ -1518,7 +1518,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == SW_MINIMIZE, "Got state %d.\n", state);
ok(state == SW_MINIMIZE, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state);
ok(state == OATRUE, "Got state %d.\n", state);
@ -1533,7 +1533,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == SW_SHOW, "Got state %d.\n", state);
ok(state == SW_SHOW, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state);
ok(state == OATRUE, "Got state %d.\n", state);
@ -1566,7 +1566,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == SW_HIDE, "Got state %d.\n", state);
ok(state == SW_HIDE, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state);
ok(state == OAFALSE, "Got state %d.\n", state);
@ -1581,7 +1581,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == SW_SHOW, "Got state %d.\n", state);
ok(state == SW_SHOW, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state);
ok(state == OATRUE, "Got state %d.\n", state);
@ -1596,7 +1596,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state);
ok(hr == S_OK, "Got hr %#x.\n", hr);
todo_wine ok(state == SW_HIDE, "Got state %d.\n", state);
ok(state == SW_HIDE, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state);
ok(state == OAFALSE, "Got state %d.\n", state);

View File

@ -402,15 +402,22 @@ HRESULT WINAPI BaseControlWindowImpl_put_WindowState(IVideoWindow *iface, LONG W
return S_OK;
}
HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *WindowState)
HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *state)
{
WINDOWPLACEMENT place;
BaseControlWindow* This = impl_from_IVideoWindow(iface);
BaseControlWindow *window = impl_from_IVideoWindow(iface);
DWORD style;
place.length = sizeof(place);
GetWindowPlacement(This->baseWindow.hWnd, &place);
TRACE("(%p/%p)->(%p)\n", This, iface, WindowState);
*WindowState = place.showCmd;
TRACE("window %p, state %p.\n", window, state);
style = GetWindowLongPtrW(window->baseWindow.hWnd, GWL_STYLE);
if (!(style & WS_VISIBLE))
*state = SW_HIDE;
else if (style & WS_MINIMIZE)
*state = SW_MINIMIZE;
else if (style & WS_MAXIMIZE)
*state = SW_MAXIMIZE;
else
*state = SW_SHOW;
return S_OK;
}