$sTitle = _WinFuncsWrapper("WinGetTitle", "[CLASS:Chrome_WidgetWin_0]")
ConsoleWrite($sTitle & @CRLF)
Func _WinFuncsWrapper($sFuncName, $sTitle, $sText="", $iOnlyVisible=1, $vParam1=0, $vParam2=0, $vParam3=0, $vParam4=0, $vParam5=0)
If $iOnlyVisible = 1 Then
If $sText <> "" Then
$aWinList = WinList($sTitle, $sText)
Else
$aWinList = WinList($sTitle)
EndIf
For $i = 1 To $aWinList[0][0]
If BitAND(WinGetState($aWinList[$i][1]), 2) = 2 Then
$sTitle = $aWinList[$i][1]
ExitLoop
EndIf
Next
EndIf
Switch $sFuncName
Case "WinActivate"
Return WinActivate($sTitle, $sText)
Case "WinActive"
Return WinActive($sTitle, $sText)
Case "WinClose"
Return WinClose($sTitle, $sText)
Case "WinExists"
Return WinExists($sTitle, $sText)
Case "WinFlash"
Return WinFlash($sTitle, $sText)
Case "WinGetClassList"
Return WinGetClassList($sTitle, $sText)
Case "WinGetClientSize"
Return WinGetClientSize($sTitle, $sText)
Case "WinGetHandle"
Return WinGetHandle($sTitle, $sText)
Case "WinGetPos"
Return WinGetPos($sTitle, $sText)
Case "WinGetProcess"
Return WinGetProcess($sTitle, $sText)
Case "WinGetState"
Return WinGetState($sTitle, $sText)
Case "WinGetText"
Return WinGetText($sTitle, $sText)
Case "WinGetTitle"
Return WinGetTitle($sTitle, $sText)
Case "WinKill"
Return WinKill($sTitle, $sText)
Case "WinList"
Return WinList($sTitle, $sText)
Case "WinMove"
Return WinMove($sTitle, $sText, $vParam1, $vParam2, $vParam3, $vParam4, $vParam5)
Case "WinSetOnTop"
Return WinSetOnTop($sTitle, $sText, $vParam1)
Case "WinSetState"
Return WinSetState($sTitle, $sText, $vParam1)
Case "WinSetTitle"
Return WinSetTitle($sTitle, $sText, $vParam1)
Case "WinSetTrans"
Return WinSetTrans($sTitle, $sText, $vParam1)
Case "WinWait"
Return WinWait($sTitle, $sText, $vParam1)
Case "WinWaitActive"
Return WinWaitActive($sTitle, $sText, $vParam1)
Case "WinWaitClose"
Return WinWaitClose($sTitle, $sText, $vParam1)
Case "WinWaitNotActive"
Return WinWaitNotActive($sTitle, $sText, $vParam1)
EndSwitch
Return SetError(1, 0, -1)
EndFunc