[PATCH 4/6] strmbase: Properly implement IVideoWindow::get_WindowState().
Zebediah Figura
z.figura12 at gmail.com
Tue Oct 8 20:02:20 CDT 2019
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
dlls/quartz/tests/videorenderer.c | 14 +++++++-------
dlls/strmbase/window.c | 21 ++++++++++++++-------
2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c
index 1c16fa1f825..96a2b1cabbf 100644
--- a/dlls/quartz/tests/videorenderer.c
+++ b/dlls/quartz/tests/videorenderer.c
@@ -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);
diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c
index 206aecb8ded..57dbaca8bf3 100644
--- a/dlls/strmbase/window.c
+++ b/dlls/strmbase/window.c
@@ -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;
}
--
2.23.0
More information about the wine-devel
mailing list