Skip to content

Instantly share code, notes, and snippets.

@blewert
blewert / EnumWindowZOrder.cpp
Last active August 7, 2024 14:56
[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));