MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / GetTopChild

Function GetTopChild

source/window.cpp:1258–1284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1256
1257
1258HWND GetTopChild(HWND aParent)
1259{
1260 if (!aParent) return aParent;
1261 HWND hwnd_top, next_top;
1262 // Get the topmost window of the topmost window of...
1263 // i.e. Since child windows can also have children, we keep going until
1264 // we reach the "last topmost" window:
1265 for (hwnd_top = GetTopWindow(aParent)
1266 ; hwnd_top && (next_top = GetTopWindow(hwnd_top))
1267 ; hwnd_top = next_top);
1268
1269 //if (!hwnd_top)
1270 //{
1271 // MsgBox("no top");
1272 // return FAIL;
1273 //}
1274 //else
1275 //{
1276 // //if (GetTopWindow(hwnd_top))
1277 // // hwnd_top = GetTopWindow(hwnd_top);
1278 // char class_name[64];
1279 // GetClassName(next_top, class_name, sizeof(class_name));
1280 // MsgBox(class_name);
1281 //}
1282
1283 return hwnd_top ? hwnd_top : aParent; // Caller relies on us never returning NULL if aParent is non-NULL.
1284}
1285
1286
1287

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected