Habe ich das richtig verstanden? Du willst ein Fenster anhand des Prozessnamens aktivieren (in den Vordergrund holen)?
Dann vielleicht so:
Spoiler anzeigen
[autoit]
_WinActivateByProcessName('firefox.exe')
ToolTip('ok')
Sleep(2000)
Exit
Func _WinActivateByProcessName($sProcessName)
Local $aProcessList, $aWinList
$aProcessList = ProcessList($sProcessName)
If @error Then Return
$aWinList = WinList()
If $aWinList[0][0] = 0 Then Return
For $i = 1 To $aWinList[0][0]
For $j = 1 To $aProcessList[0][0]
If WinGetProcess($aWinList[$i][1]) = $aProcessList[$j][1] Then
WinActivate($aWinList[$i][1])
Return ; diese Zeile weglassen, dann werden alle Fenster des Prozesses nach vorne geholt
EndIf
Next
Next
EndFunc