[Lazarus] Win32 API replacement calls

A.J. Venter aj at outkastsolutions.co.za
Thu Jun 12 11:31:58 CEST 2008


> I'm not sure where you are going to get the FWinHandle from. I'm
> pretty sure you can query the X Server for a list of child windows
> from XRootWindow().

Apps can get their own window handle and there is a program included
in the X utils that can query the winhandle  (and some other things)
of any particular open window - check the manpage for xwininfo. There
is even a utility (xlsclients) which will list all running clients on
the X server giving you the process that owns them and the winhandle
they are using - you could contact xlsclients over a tprocess but most
distro's no longer install the x utils by default so I would rather
suggest you install the source package for x-utils (whatever your
distro calls it) and look at the source  code for xlsclients then see
which functions it uses to do that query and write a small function
that can query winhandles by processname or something (of course a
process can open many windows).

How were you thinking of having your app identify the target window ?
With a click ? If so you could possibly call xwininfo in a tprocess,
and get the ID from the output, or you could check the source for
Xwininfo to see how it finds out the ID from the click and adapt it to
whatever input method you had in mind.

> The rest is easy... But do remember, like A.J. said. When you call
> xlib functions they tend to create hints and you ask the Window
> Manager to fullfill that hint (request), but it isn't garaunteed. You
> are simply asking, not telling it what to do.
Aye, some of the more obscure ones don't even HAVE windows as we think
of them... quite a few cannot minimize or iconify, probably the
MAJORITY don't have taskbars built in (but icewm does, while KDE and
Gnome puts the taskbars in entirely sepperate programs to the window
managers), and I know of at least one that HAS no mouse interaction
with windows. Apps can use the mouse, but you cannot use it to switch
windows or maximise them or anything.
That said, KDE and gnome are between them about 80% of all Linux
desktops, about 5% will be stuff like E17 and the last 15 is the
various others combined, and KDE/Gnome handles probably almost every
thing you can ask for, at least, if the user hasn't disabled it or
overwritten it (both can tune their handling of window manager hints
to deliberately ignore some or do something DIFFERENT when they
receive them, mostly on a per-application basis, usually to get apps
to work nicer in the specific environment)

Ciao
A.J.
-- 
A.J. Venter
Chief Executive Officer
Tel.: +27 21 554 5059
Fax: +27 11 252 9197
Outkast Solutions IT
www.outkastsolutions.co.za
A division of Global Pact Trading Pty Ltd.

www.silentcoder.co.za - Blog
scartoonz.silentcoder.co.za - ScarToonz webcomic



More information about the Lazarus mailing list