[PATCH] user32: Return correct showCmd from GetWindowPlacement() for other process window.

Alexandre Julliard julliard at winehq.org
Tue Aug 13 04:30:20 CDT 2019


Paul Gofman <gofmanp at gmail.com> writes:

> On 8/13/19 12:12, Alexandre Julliard wrote:
>> Paul Gofman <gofmanp at gmail.com> writes:
>>
>>> @@ -1280,11 +1280,38 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
>>>      }
>>>      if (pWnd == WND_OTHER_PROCESS)
>>>      {
>>> -        if (!IsWindow( hwnd )) return FALSE;
>>> -        FIXME( "not supported on other process window %p\n", hwnd );
>>> -        /* provide some dummy information */
>>> +        DWORD style, is_window;
>>> +
>>> +        FIXME( "not fully supported on other process window %p.\n", hwnd );
>>> +
>>> +        SERVER_START_REQ( set_window_info )
>>> +        {
>>> +            req->handle = wine_server_user_handle( hwnd );
>>> +            req->flags  = 0;  /* don't set anything, just retrieve */
>>> +            req->extra_offset = -1;
>>> +            req->extra_size = 0;
>>> +            if (wine_server_call_err( req ))
>>> +            {
>>> +                style = 0;
>>> +                is_window = FALSE;
>>> +            }
>>> +            else
>>> +            {
>>> +                style = reply->old_style;
>>> +                is_window = TRUE;
>>> +            }
>>> +        }
>>> +        SERVER_END_REQ;
>>> +
>>> +        if (!is_window)
>>> +            return FALSE;
>> You can use GetWindowLong() for this, there's no need to add a server
>> call here.
>>
> This will add an extra server call for other process window from
> GetWindowLong(). The two were already there: one for IsWindow(), another
> for getting rectangle below. I thought it might be better not to
> introduce the third one. Should I use GetWindowLong() regardless?

Yes. If you want to improve it, you can avoid IsWindow() and check for
GetWindowRect() failure or something like that. But either way I don't
expect GetWindowPlacement() to be timing-critical.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list