#include <stdio.h>
#include <windows.h>

int main()
{
  HWND hwnd = GetAncestor(NULL, GA_PARENT);
  printf("%p\n", hwnd);
  hwnd = GetAncestor(NULL, GA_ROOT);
  printf("%p\n", hwnd);
  hwnd = GetAncestor(NULL, GA_ROOTOWNER);
  printf("%p\n", hwnd);
  hwnd = GetAncestor(NULL, 0);
  printf("%p\n", hwnd);
  return 0;
}

printed four 0's for me on Vista.

On Thu, Mar 19, 2009 at 11:27 AM, Craig Schlenter
<[email protected]> wrote:
>
> Hi
>
> OK, that's interesting, thank you.  Does GetAncestor return something
> valid when passed that null HWND or does it pass null through to
> GetwindowRect? It would also be interesting to know what rect it
> returns please. Maybe it doesn't matter ... I haven't looked at the
> renderer code that creates this request to see if it actually cares
> about this when the window is null.
>
> Thank you,
>
> --Craig
>
> On Thu, Mar 19, 2009 at 7:56 PM, Mohamed Mansour
> <[email protected]> wrote:
>> Craig, it returns back a 0.
>> +               window  0x00000000 {unused=??? }        HWND__ *
>>
>>
>>
>>
>> On Thu, Mar 19, 2009 at 1:46 PM, Craig Schlenter
>> <[email protected]> wrote:
>>>
>>> Hi Avi
>>>
>>> When I did the original change, that function wasn't being called with
>>> a null window.
>>> Clicking on a link in gmail opened the link in a new window as I
>>> recall. At some later
>>> point that changed possibly when some of the tab_contents stuff was hooked 
>>> up. I
>>> think it's good practice to check for null since you don't want the
>>> renderer to be able
>>> to crash the browser but I do tend to think that it shouldn't be
>>> happening to begin with
>>> but I'm largely clueless about the code involved :(
>>>
>>> Perhaps someone with a windows build can put a breakpoint in
>>> OnGetRootWindowRect please and see if clicking on a link in an
>>> email in gmail passes a HWND of null at all?
>>>
>>> Thank you,
>>>
>>> --Craig
>>>
>>> On Thu, Mar 19, 2009 at 7:33 PM, Avi Drissman <[email protected]> wrote:
>>>> We've been seeing calls to ResourceMessageFilter::OnGet(Root)WindowRect for
>>>> NULL windows. agl put in a fix for GTK with
>>>> http://codereview.chromium.org/42356 and I'm seeing the same problem on the
>>>> Mac.
>>>>
>>>> 1. Why isn't Windows seeing this? What happens when you pass a null HWND
>>>> into ::GetAncestor and ::GetWindowRect?
>>>> 2. Is this expected, or is this indicative of a bug?
>>>>
>>>> Avi
>>>>
>>>
>>> >>
>>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to