For Windows, another way to get top-level windows (besides EnumWindows, which uses a callback) is to get the first child of the desktop and then retrieve all its siblings:
HWND wnd = GetWindow(GetDesktopWindow(), GW_CHILD);
while (wnd) {
wnd = GetNextWindow(wnd, GW_HWNDNEXT);
}
, GetSystemMenu, FALSE - . GetMenu, , .
, , , . - , , (, WH_GETMESSAGE WH_CBT) WM_SYSCOMMAND.