can windows be reparented?

Medland, Bill Bill.Medland at accpac.com
Wed Aug 14 11:27:04 CDT 2002


> -----Original Message-----
> From: Dmitry Timoshkov [mailto:dmitry at baikal.ru]
> Sent: Tuesday, August 13, 2002 6:33 PM
> To: us at the-edmeades.demon.co.uk
> Cc: wine-devel at winehq.com
> Subject: Re: Re:can windows be reparented?
> 
> 
> <us at the-edmeades.demon.co.uk> wrote:
> 
> > To be honest I never investigated further once I commented 
> out the SetParent call,
> > as I was continuing to fix oleaut32 and left the gui side 
> to someone else!
> > 
> > I know it was being called in the failing case, and 
> removing it allowed the
> > windows to pop up, BUT they were still wrong as you could 
> access the 'parent'
> > whereas you should not be able to
> 
> Could you please test patch posted by Bill Medland to 
> wine-patches today? It's
> not entirely correct though. My tests show that 
> SetWindowLong(GWL_HWNDPARENT)
> call changes simultaneously both parent and owner for top 
> level windows and
> returns old value (not sure old owner or parent it is).

Even if the window is not in fact a child?  Please excuse my ignorance here;
I am still a little shaky on terminology.  Surely if it is a top level
window then its parent is the desktop and always will be.

Or are you saying that it reparents to the desktop (and so the problem is
down in the SetParent code)?

> 
> But top level windows created by Visual Vasic are special: 
> they have no parent,
> but only owner according to Spy++. In my tests I can't 
> reproduce it yet.

So you suspect that Spy++ is not telling the truth?  (It wouldn't be the
first time)

> 
> A bit of investigation of Wine source revealed that some places use
> GetAncestor(hwnd, GA_PARENT), while others use GetParent(hwnd).

And, in the case of WIN_CreateWindowEx, GetAncestor (hwnd, GA_ROOT)

> Since
> their behaviour is different in respect of top level and 
> child windows,
> some major clean up in that area in Wine is needed.

Careful.

In our particular case, according to Spy++ the owner of the ThunderRT6FormDC
is a third-generation window. viz. the actual window requested, not one of
its ancestors.

i.e. I see the call to SetWindowLong (30056 (The ThunderRT6FormDC), -8,
10046 (The ThunderRT6UserControlDC))

I guess an important point here is that in our case the Visual Basic is an
OCX sitting inside a container and so the ThunderRT6UserControlDC is not
first generation.

> 
> -- 
> Dmitry.
> 
> 
> 
> 
Hope this helps.

Bill



More information about the wine-devel mailing list