<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 9, 2020 at 6:23 PM Gabriel Ivăncescu <<a href="mailto:gabrielopcode@gmail.com">gabrielopcode@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 09/01/2020 16:46, Zebediah Figura wrote:<br>
> On 1/9/20 7:13 AM, Gabriel Ivăncescu wrote:<br>
>> Signed-off-by: Gabriel Ivăncescu <<a href="mailto:gabrielopcode@gmail.com" target="_blank">gabrielopcode@gmail.com</a>><br>
>> ---<br>
>>   dlls/quartz/tests/filtergraph.c | 35 ++++++++++++++++++++++++++++++++-<br>
>>   1 file changed, 34 insertions(+), 1 deletion(-)<br>
>><br>
>> diff --git a/dlls/quartz/tests/filtergraph.c <br>
>> b/dlls/quartz/tests/filtergraph.c<br>
>> index ca45031..726c54a 100644<br>
>> --- a/dlls/quartz/tests/filtergraph.c<br>
>> +++ b/dlls/quartz/tests/filtergraph.c<br>
>> @@ -4232,16 +4232,38 @@ static HWND get_renderer_hwnd(IFilterGraph2 <br>
>> *graph)<br>
>>       return hwnd;<br>
>>   }<br>
>> +static LRESULT CALLBACK parent_wndproc(HWND hwnd, UINT msg, WPARAM <br>
>> wParam, LPARAM lParam)<br>
>> +{<br>
>> +    switch (msg)<br>
>> +    {<br>
>> +        case WM_PARENTNOTIFY:<br>
>> +            if (LOWORD(wParam) == WM_DESTROY)<br>
>> +                ok(0, "Received WM_PARENTNOTIFY with WM_DESTROY.\n");<br>
>> +        break;<br>
>> +    }<br>
>> +    return DefWindowProcA(hwnd, msg, wParam, lParam);<br>
>> +}<br>
>> +<br>
>>   static void test_window_threading(void)<br>
>>   {<br>
>>       WCHAR *filename = load_resource(avifile);<br>
>>       IFilterGraph2 *graph = create_graph();<br>
>> +    WNDCLASSA cls = { 0 };<br>
>> +    HWND hwnd, parent;<br>
>>       HRESULT hr;<br>
>>       DWORD tid;<br>
>>       ULONG ref;<br>
>> -    HWND hwnd;<br>
>>       BOOL ret;<br>
>> +    cls.lpfnWndProc   = parent_wndproc;<br>
>> +    cls.hInstance     = GetModuleHandleA(NULL);<br>
>> +    cls.hCursor       = LoadCursorA(0, (const char*)IDC_ARROW);<br>
>> +    cls.lpszClassName = "TestParent";<br>
>> +    RegisterClassA(&cls);<br>
>> +<br>
>> +    parent = CreateWindowExA(0, "TestParent", NULL, <br>
>> WS_OVERLAPPEDWINDOW, 50, 50, 150, 150, NULL, NULL, cls.hInstance, NULL);<br>
>> +    ok(parent != NULL, "Failed to create parent window.\n");<br>
>> +<br>
>>       hr = IFilterGraph2_RenderFile(graph, filename, NULL);<br>
>>       if (FAILED(hr))<br>
>>       {<br>
>> @@ -4256,6 +4278,10 @@ static void test_window_threading(void)<br>
>>       {<br>
>>           tid = GetWindowThreadProcessId(hwnd, NULL);<br>
>>           ok(tid != GetCurrentThreadId(), "Window should have been <br>
>> created on a separate thread.\n");<br>
>> +        ok(!(GetWindowLongW(hwnd, GWL_EXSTYLE) & <br>
>> WS_EX_NOPARENTNOTIFY), "Window has WS_EX_NOPARENTNOTIFY.\n");<br>
>> +<br>
>> +        SetParent(hwnd, parent);<br>
>> +        SetWindowLongW(hwnd, GWL_STYLE, GetWindowLongW(hwnd, <br>
>> GWL_STYLE) | WS_CHILD);<br>
> <br>
> Does the application actually do this, or does it use <br>
> IVideoWindow::put_Owner()? If it is the former, I'd like to see a <br>
> comment to that effect.<br>
> <br>
<br>
I actually don't know what the app does when it sets the parent. I wrote <br>
the test to see if Windows notifies the parent, and it seems that it <br>
doesn't (I also set the WS_CHILD just in case), despite not having the <br>
WS_EX_NOPARENTNOTIFY style in the first place. Wine would fail this test <br>
without the first patch, even without put_Owner.<br>
<br>
I'll investigate what the app does. However, while this patchset fixes <br>
that app, I thought a more generic solution would be preferable, since <br>
that's how Windows seems to work (unless you have a better idea).<br></blockquote><div><br></div><div>I don't understand how this window is set, just from this test alone. But, is it possible to subclass application window, and simply not forward certain messages?</div><div><br></div><div>You can probably even test if it was subclassed when message returns.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Also, by comment, you meant in the test file as C comment, right?<br>
<br>
Thanks,<br>
Gabriel<br>
<br>
</blockquote></div></div>