On 7/7/22 14:19, Zebediah Figura wrote:
On 7/5/22 06:34, Akihiro Sagawa wrote:
@@ -1458,11 +1459,14 @@ static void test_video_window(HWND hwnd) const WCHAR *filename = load_resource(L"test.mpg"); MCI_PARMS_UNION parm; MCIERROR err; + WCHAR text[32], original[32]; HWND video_window, parent; MCIDEVICEID wDeviceID; DWORD style, expected; BOOL ret; + GetWindowTextW(hwnd, original, ARRAY_SIZE(original));
parm.dgv_open.lpstrDeviceType = (WCHAR *)L"MPEGVideo"; parm.dgv_open.lpstrElementName = (WCHAR *)filename; parm.dgv_open.hWndParent = hwnd; @@ -1485,9 +1489,78 @@ static void test_video_window(HWND hwnd) expected = (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW) & ~WS_MAXIMIZEBOX; ok(style == expected, "expected style %08lx, got %08lx\n", expected, style); + err = mciSendCommandW(wDeviceID, MCI_WINDOW, 0, (DWORD_PTR)&parm); + ok(!err,"mciCommand window 0 returned %s\n", dbg_mcierr(err));
+ parm.win.lpstrText = (LPWSTR)L"abracadabra"; + err = mciSendCommandW(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_TEXT, (DWORD_PTR)&parm); + ok(!err,"mciCommand window text returned %s\n", dbg_mcierr(err));
+ GetWindowTextW(video_window, text, ARRAY_SIZE(text)); + todo_wine ok(!wcscmp(text, parm.win.lpstrText),"expected %s, got %s\n", debugstr_w(parm.win.lpstrText), debugstr_w(text));
+ ok(!IsWindowVisible(video_window), "video window (%p) should be hidden\n", video_window);
+ /* MCI_PLAY shows default video window */ + err = mciSendCommandW(wDeviceID, MCI_PLAY, 0, (DWORD_PTR)&parm); + ok(!err,"mciCommand play returned %s\n", dbg_mcierr(err)); + ok(IsWindowVisible(video_window), "video window (%p) should be visible\n", video_window);
+ /* MCI_STOP doesn't hide the window */ + err = mciSendCommandW(wDeviceID, MCI_STOP, 0, (DWORD_PTR)&parm); + ok(!err,"mciCommand stop returned %s\n", dbg_mcierr(err)); + ok(IsWindowVisible(video_window), "video window (%p) should be visible\n", video_window);
+ parm.win.nCmdShow = SW_HIDE; + err = mciSendCommandW(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_STATE, (DWORD_PTR)&parm); + ok(!err,"mciCommand window state returned %s\n", dbg_mcierr(err)); + todo_wine ok(!IsWindowVisible(video_window), "video window (%p) should be hidden\n", video_window);
+ parm.win.hWnd = (HWND)0xdeadbeef; + err = mciSendCommandW(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_HWND, (DWORD_PTR)&parm); + todo_wine ok(err == MCIERR_NO_WINDOW, "mciCommand window hwnd returned %s\n", dbg_mcierr(err));
+ parm.win.hWnd = hwnd; + err = mciSendCommandW(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_HWND, (DWORD_PTR)&parm); + ok(!err,"mciCommand window hwnd returned %s\n", dbg_mcierr(err));
+ parm.status.dwItem = MCI_DGV_STATUS_HWND; + parm.status.dwReturn = 0xdeadbeef; + err = mciSendCommandW(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM, (DWORD_PTR)&parm); + ok(!err,"mciCommand status hwnd returned %s\n", dbg_mcierr(err)); + video_window = (HWND)parm.status.dwReturn;
+ ok(video_window == hwnd, "got %p, expected %p\n", video_window, hwnd);
+ parm.win.lpstrText = (LPWSTR)L"foobar"; + err = mciSendCommandW(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_TEXT, (DWORD_PTR)&parm); + ok(!err,"mciCommand window text returned %s\n", dbg_mcierr(err));
+ GetWindowTextW(hwnd, text, ARRAY_SIZE(text)); + todo_wine ok(!wcscmp(text, parm.win.lpstrText),"expected %s, got %s\n", debugstr_w(parm.win.lpstrText), debugstr_w(text));
+ parm.win.lpstrText = NULL; + err = mciSendCommandW(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_TEXT, (DWORD_PTR)&parm); + ok(!err,"mciCommand window text returned %s\n", dbg_mcierr(err)); + GetWindowTextW(hwnd, text, ARRAY_SIZE(text)); + todo_wine ok(!wcscmp(text, L""), "expected L"", got %s\n", debugstr_w(text));
+ /* MCI_PLAY shows parent window */ + err = mciSendCommandW(wDeviceID, MCI_PLAY, 0, (DWORD_PTR)&parm); + ok(!err,"mciCommand play returned %s\n", dbg_mcierr(err)); + ok(IsWindowVisible(hwnd), "window (%p) should be visible\n", hwnd);
+ parm.win.nCmdShow = SW_HIDE; + err = mciSendCommandW(wDeviceID, MCI_WINDOW, MCI_DGV_WINDOW_STATE, (DWORD_PTR)&parm); + ok(!err,"mciCommand window state returned %s\n", dbg_mcierr(err)); + todo_wine ok(!IsWindowVisible(hwnd), "window (%p) should be hidden\n", hwnd);
err = mciSendCommandW(wDeviceID, MCI_CLOSE, 0, 0); ok(!err,"mciCommand close returned %s\n", dbg_mcierr(err)); + SetWindowTextW(hwnd, original); + ShowWindow(hwnd, SW_HIDE);
What's the point of this?
To clarify, I mean restoring the previous text and hiding the window.