On 7/5/22 06:34, Akihiro Sagawa wrote:
+static void test_video_window(HWND hwnd) +{
- const WCHAR *filename = load_resource(L"test.mpg");
- MCI_PARMS_UNION parm;
- MCIERROR err;
- HWND video_window, parent;
- MCIDEVICEID wDeviceID;
- DWORD style, expected;
- BOOL ret;
- parm.dgv_open.lpstrDeviceType = (WCHAR *)L"MPEGVideo";
- parm.dgv_open.lpstrElementName = (WCHAR *)filename;
- parm.dgv_open.hWndParent = hwnd;
- err = mciSendCommandW(0, MCI_OPEN,
MCI_OPEN_ELEMENT | MCI_OPEN_TYPE | MCI_DGV_OPEN_PARENT,
(DWORD_PTR)&parm);
- ok(!err,"mciCommand open test.mpg type MPEGVideo returned %s\n", dbg_mcierr(err));
- wDeviceID = parm.dgv_open.wDeviceID;
- parm.status.dwItem = MCI_DGV_STATUS_HWND;
- parm.status.dwReturn = 0xdeadbeef;
- err = mciSendCommandW(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM, (DWORD_PTR)&parm);
- todo_wine ok(!err,"mciCommand status hwnd returned %s\n", dbg_mcierr(err));
- if (err)
- {
skip("MCI_DGV_STATUS_HWND got an error\n");
goto close;
- }
- video_window = (HWND)parm.status.dwReturn;
- ok(IsWindow(video_window), "video window %p doesn't exist.\n", video_window);
- parent = GetWindow(video_window, GW_OWNER);
- ok(hwnd == parent, "expected owner %p, got %p\n", hwnd, parent);
- style = GetWindowLongW(video_window, GWL_STYLE);
- expected = (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW) & ~WS_MAXIMIZEBOX;
- ok(style == expected, "expected style %08lx, got %08lx\n", expected, style);
Could you please also test the case where no parent is specified?
+close:
- err = mciSendCommandW(wDeviceID, MCI_CLOSE, 0, 0);
- ok(!err,"mciCommand close returned %s\n", dbg_mcierr(err));
- ret = DeleteFileW(filename);
- ok(ret, "Failed to delete %s, error %lu.\n", debugstr_w(filename), GetLastError());
+}