[Lazarus] FindWindow return sequence (Windows 10)?

Sven Barth pascaldragon at googlemail.com
Mon Nov 2 11:08:32 CET 2020


Bo Berglund via lazarus <lazarus at lists.lazarus-ide.org> schrieb am Mo., 2.
Nov. 2020, 08:07:

> I thought that GetWindow(hWndTemp, GW_HWNDNEXT); would return the next
> larger handle following hWndTemp, but it seems like this is not the
> case. Is the result random or is there some known sequence when using
> the flag GW_HWNDNEXT??
>


The documentation about GW_HWNDNEXT on MSDN says this:

=== MSDN begin ===

The retrieved handle identifies the window below the specified window in
the Z order.
If the specified window is a topmost window, the handle identifies a
topmost window. If the specified window is a top-level window, the handle
identifies a top-level window. If the specified window is a child window,
the handle identifies a sibling window.

=== MSDN end ===

So nowhere does it guarantee that the handles values themselves are ordered
only that the resulting windows are ordered in some way.

In general you should not rely on the order of Handle values, because from
the perspective of the application they are to be considered as random.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20201102/69832569/attachment.html>


More information about the lazarus mailing list