#include #include #include #include "GetRealErrorLine.au3" Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Global $file = FileOpenDialog("Script à analyser", "", "AutoIt (*.au3)") If(@error) Then Exit Global $line = InputBox("Ligne", "Ligne") If(@error) Then Exit Global $error = GetRealErrorLine($file, $line) If(UBound($error) == 0) Then Exit MsgBox(16, "Erreur", "La ligne " & $line & " n'a pas été trouvée.") Global $gui Global $edit Global $button Global $taille[2] = [500, 300] Global $bordure = 10 Global $tailleLabel = 20 Global $tailleButton = 50 $gui = GUICreate("", $taille[0], $taille[1]) GUISetOnEvent($GUI_EVENT_CLOSE, "quit", $gui) GUICtrlCreateLabel("Fichier : " & $error[0], $bordure, $bordure, $taille[0] - 3*$bordure - $tailleButton, $tailleLabel*2) $button = GUICtrlCreateButton("Ouvrir", $taille[0] - $bordure - $tailleButton, $bordure, $tailleButton, $tailleLabel) GUICtrlSetOnEvent($button, "open") $edit = GUICtrlCreateEdit("", $bordure, 2*$bordure + $tailleLabel*2, $taille[0] - 2*$bordure, $taille[1] - 3*$bordure - 2*$tailleLabel, BitOR($WS_VISIBLE, $WS_VSCROLL)) GUICtrlSetFont($edit, 8.5, 0, 0, "Courier New") For $i = 1 To UBound($error, 1)-1 Local $err = ($i == UBound($error, 1)/2) ? " <- ERROR" : "" GUICtrlSetData($edit, $error[$i] & $err & @CRLF, 1) Next GUISetState(@SW_SHOW, $gui) While(True) Sleep(10) WEnd Func open() ShellExecute($error[0]) WinActivate(WinWait($error[0])) Send("^f") Local $hwnd = WinWaitActive("[CLASS:#32770]") ControlSetText($hwnd, "", "[CLASS:Edit; INSTANCE:1]", $error[UBound($error, 1)/2]) ControlClick($hwnd, "", "[CLASS:Button; INSTANCE:10]") EndFunc Func quit() Exit EndFunc