Skip to content

Instantly share code, notes, and snippets.

@sleeplessman
sleeplessman / EnumWindowZOrder.cpp
Created June 20, 2024 00:29 — forked from blewert/EnumWindowZOrder.cpp
[windows.h] Iterating over all desktop windows in C++, by z-order
//Find the top-most window. We need the Z-order to be
//relative to this
HWND window = GetTopWindow(GetDesktopWindow());
do
{
//Your code
}
while (window = GetWindow(window, GW_HWNDNEXT));