Zitat von SteveG <steveg@nevets.com.au>:

> Evening all (or as your timezone requires)
>
> I have a Windows library of functions being converted to Linux
> equivalents (slowly) - but a few things are losing me on the way
>
> Win function: EnumWindows and EnumChildWindows return all window handles
> and children as used directly by the LCL.
>  xQueryTree in Lin returns TWindow pointers, which are not direct
> handles to the window.
>  How do I determine the actual window handle from the TWindow returned,
> and will this also allow me to find the 'name' of the window / control,
> not just the Title.
>  If I use GDK_WINDOW_XWINDOW(
> PGdkWindowPrivate(GTK_WIDGET(WinHandle)^.window)) on a window 'handle'
> passed from the LCL, it gives me the
>  TWindow pointer associated, but seems to be the top level window for
> the project, not a pointer the 'control' itself (I think)

The gtk does not create for every widget a window. That means some childs share
their parent xwindow.
The gtk2 has reduced that even further. Almost all childs share their parent
xwindow.


>  I am working on the assumption that each window/control
> (forms/buttons/etc) are TWindows ? -
>  If not, how do I enum the windows/controls associated with a specific
> TWindow and determine the 'controls' window handle and name ?

The LCL has a tree structure, and the gtk as well. Basically for each LCL
control there can be several gtk widgets. Both trees can be used to traverse.


> To summarize:
>  Under Linux I would like to enumerate all open windows and their
> children, gathering 'actual' window handles, and control names (to be
> used within the LCL).
>
> :and just as an extra :)
> Win function: WindowFromPoint(Point :TPoint) returns the handle of the
> window at x,y of Point
>   Is there a Lin equiv ? - xQueryPointer seems close, but only returns
> window at curr cursor position

See FindLCLWindow, FindLCLControl, FindOwnerControl.


> any suggestions really appreciated. (really)

Keep in mind, that your code will rely on gtk and LCL internals, which are not
supported, and can change any time without announcement.


Mattias


