Code: Select all
q:: ;window get control info with indentation to indicate hierarchy
hWnd := WinGetID("A")
MsgBox(Clipboard := JEE_WinGetDescendants(hWnd))
return
JEE_WinGetDescendants(hWnd)
{
local
DetectHiddenWindows("On")
oCtlList := WinGetControls("ahk_id " hWnd)
vOutput := ""
Loop oCtlList.Length
;Loop % oCtlList.Length() ;AHK v1
{
vCtlClassNN := oCtlList[A_Index]
hCtl := ControlGetHwnd(vCtlClassNN, "ahk_id " hWnd)
vPfx := ""
Loop
{
hCtl := DllCall("user32\GetAncestor", "Ptr",hCtl, "UInt",1, "Ptr") ;GA_PARENT := 1
if (hCtl = hWnd)
break
vPfx .= "`t"
}
vOutput .= vPfx vCtlClassNN "`r`n"
}
return vOutput
}