use somthing like this i guess.
Opt("WinTitleMatchMode", 4)
Global $KillList[3][4] = [ _
["this window", "class 1","calss 2","class 3"], _
["that window", "class 1","calss 2","class 3"], _
["another window", "class 1","calss 2","class 3"] _
]
Global $CTRLs = ''
Global $WinList
AdlibRegister("Monitor",500)
While 1
Sleep(500)
WEnd
Func Monitor
()
$WinList = WinList()
For $I = 0 To $WinList[0][0]
For $V = 0 To UBound($KillList,1) - 1
If StringInStr($WinList[$I][0],$KillList[$V][0]) Then
$CTRLs = _WinGetControls
($WinList[$I][0])
For $R = 0 To UBound($CTRLs) - 1
For $E = 1 To UBound($KillList,2) - 1
If StringInStr($CTRLs[$R][0],$KillList[$V][$E]) Then
;
;
EndIf
Next
Next
EndIf
Next
Next
EndFunc
Func _WinGetControls
($Title, $Text = "")
Local $WndControls, $aControls, $sLast = "", $n = 1
$WndControls = WinGetClassList($Title, $Text)
$aControls = StringSplit($WndControls, @CRLF)
Dim $aResult[$aControls[0] + 1][2]
For $i = 1 To $aControls[0]
If $aControls[$i] <> "" Then
If $sLast = $aControls[$i] Then
$n += 1
Else
$n = 1
EndIf
$aControls[$i] &= $n
$sLast = StringTrimRight($aControls[$i], 1)
EndIf
If $i < $aControls[0] Then
$aResult[$i][0] = $aControls[$i]
Else ; last item in array
$aResult[$i][0] = WinGetTitle($Title) ; return WinTitle
EndIf
$aResult[$i][1] = ControlGetHandle($Title, $Text, $aControls[$i])
Next
$aResult[0][0] = "ClassnameNN"
$aResult[0][1] = "Handle"
Return $aResult
EndFunc ;==>_WinGetControls