Skip to content

Instantly share code, notes, and snippets.

@blewert
blewert / EnumWindowZOrder.cpp
Last active July 22, 2024 02:43
[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));