[Lazarus] FindWindow return sequence (Windows 10)?

Bo Berglund bo.berglund at gmail.com
Mon Nov 2 11:14:04 CET 2020

On Mon, 2 Nov 2020 11:08:32 +0100, Sven Barth via lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>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.

OK, thanks!
I just want to find the handles of windows related to each other...
So I will disregard the numerical order.

Bo Berglund
Developer in Sweden

More information about the lazarus mailing list