#Include <WindowsConstants.au3>
#Include <WinAPI.au3>
Opt('WinWaitDelay', 0)
_WinChildHide('Untitled - Notepad')
Func _WinChildHide($hOwner, $sText = '')
$hOwner = WinGetHandle($hOwner, $sText)
If Not $hOwner Then
Return 0
EndIf
Local $aList = WinList()
If IsArray($aList) Then
For $i = 1 To $aList[0][0]
If (BitAND(WinGetState($aList[$i][1]), 2)) And (_WinAPI_GetAncestor($aList[$i][1], $GA_ROOTOWNER) = $hOwner) Then
$aClassList = StringSplit(_WinGetNumeratedClassList($aList[$i][1]), @CRLF, 1)
;~ WinSetState($aList[$i][0], '', @SW_HIDE)
ConsoleWrite($aList[$i][0] & @CRLF & @TAB)
For $j = 1 To $aClassList[0]
;~ ControlHide($aList[$i][1], '', $aClassList[$j])
ConsoleWrite($aClassList[$j] & @CRLF)
If $j < $aClassList[0] Then
ConsoleWrite(@TAB)
EndIf
Next
EndIf
Next
EndIf
Return 1
EndFunc
Func _WinGetNumeratedClassList($sTitle, $sText="")
Local $sClassList = WinGetClassList($sTitle, $sText)
Local $aClassList = StringSplit(StringStripWS($sClassList, 3), @LF)
Local $sRetClassList = "", $sHold_List = "|"
Local $aiInHold, $iInHold
For $i = 1 To UBound($aClassList) - 1
If StringRegExp($sHold_List, "\|" & $aClassList[$i] & "~(\d+)\|") Then
$aiInHold = StringRegExp($sHold_List, ".*\|" & $aClassList[$i] & "~(\d+)\|.*", 1)
$iInHold = Number($aiInHold[UBound($aiInHold)-1])
If $iInHold = 0 Then $iInHold += 1
$aClassList[$i] &= "~" & $iInHold + 1
$sHold_List &= $aClassList[$i] & "|"
$sRetClassList &= $aClassList[$i] & @CRLF
Else
$aClassList[$i] &= "~1"
$sHold_List &= $aClassList[$i] & "|"
$sRetClassList &= $aClassList[$i] & @CRLF
EndIf
Next
Return StringReplace(StringStripWS($sRetClassList, 3), "~", "")
EndFunc