[..] Localiser un programme avant de le lancer
Posté : lun. 10 juin 2013 22:29
par FoX
Bonjour !
Mon script est fonctionnel, grace aux aides, membres et recherches
Cependant, j'ai sur une partie du script le lancement d'un programme
J'aimerai que le script puisse localiser le programme s'il n'est pas a cet emplacement et malgré mes recherches, je n'ai pas compris la manipulation a effectuer.
Merci de votre aide
Mon script est fonctionnel, grace aux aides, membres et recherches
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 210, 232, 221, 153)
$Label1 = GUICtrlCreateLabel("Choix du logiciel", 13, 50, 180, 35, $SS_CENTER)
GUICtrlSetFont(-1, 20, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x0066FF)
$APPLIQUE = GUICtrlCreateButton("Démarrer", 8, 166, 193, 50, $WS_GROUP)
$SELECTION = GUICtrlCreateCombo("EPSON Scan", 8, 109, 194, 25)
GUICtrlSetData(-1, "VueScan 9.xx", "EPSON Scan")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $APPLIQUE
$read_combo = GUICtrlRead( $SELECTION)
If $read_combo = "EPSON Scan" Then
GUISetState(@SW_HIDE)
$sleep = InputBox("IMPORTANT"," Définir le temps d'attente entre chaque numérisation. Ce délai est à définir en secondes.","00")
$Process = Run("C:\Windows\twain_32\escndv\escndv.exe")
WinWaitactive("EPSON Scan")
Sleep (3000)
For $i = 0 To 600 Step 1
WinActivate("EPSON Scan")
Send("!s")
WinWait("EPSON TIFF Plug-in")
$cpt = 0
$sec = 30
$barre= 0
$i = 0
#Region ### START Koda GUI section ###
$Form1 = GUICreate("",480, 129, -1, -1)
GUICtrlSetCursor (-1, 1)
TrayTip("EPSON Scan", "changement de page en attente", 10)
$Label1 = GUICtrlCreateLabel("Changez de page, scanner en attente.", 13, 22, 446, 35, $SS_CENTER)
GUICtrlSetFont(-1, 20, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x0066FF)
$Button1 = GUICtrlCreateButton("Quitter", 380, 88, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Pause 5min", 290, 88, 75, 25, $WS_GROUP)
$Progress1 = GUICtrlCreateProgress(25, 88, 250, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section #
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button1
WinClose("EPSON Scan")
Exit
Case $msg = $Button2
sleep(50000)
EndSelect
If $barre = 0 Then
$i = $i + 1
$cpt = $cpt + 1
GUICtrlSetData($Progress1,$i)
Sleep($sleep*10)
EndIf
If $i = 100 Then
$barre = 1
GUIDelete("")
ExitLoop
EndIf
WEnd
Next
ElseIf $read_combo = "VueScan 9.xx" Then
GUISetState(@SW_HIDE)
$sleep = InputBox("IMPORTANT"," Définir le temps d'attente entre chaque numérisation. Ce délai est à définir en secondes.","00")
$Process = Run("H:\VueScan\VueScan\vuescan.exe")
WinWaitactive("VueScan 9 x64 (9.0.28)")
Sleep (3000)
For $i = 0 To 600 Step 1
WinActivate("VueScan")
Send("^n")
WinWait("page")
WinClose("page")
$cpt = 0
$sec = 30
$barre= 0
$i = 0
#Region ### START Koda GUI section ###
$Form1 = GUICreate("",480, 129, -1, -1)
GUICtrlSetCursor (-1, 1)
TrayTip("VueScan", "changement de page en attente", 10)
$Label1 = GUICtrlCreateLabel("Changez de page, scanner en attente.", 13, 22, 446, 35, $SS_CENTER)
GUICtrlSetFont(-1, 20, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x0066FF)
$Button1 = GUICtrlCreateButton("Quitter", 380, 88, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Pause 5min", 290, 88, 75, 25, $WS_GROUP)
$Progress1 = GUICtrlCreateProgress(25, 88, 250, 25)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section #
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button1
WinClose("VueScan 9 x64 (9.0.28)")
Exit
Case $msg = $Button2
sleep(50000)
EndSelect
If $barre = 0 Then
$i = $i + 1
$cpt = $cpt + 1
GUICtrlSetData($Progress1,$i)
Sleep($sleep*10)
EndIf
If $i = 100 Then
$barre = 1
GUIDelete("")
ExitLoop
EndIf
WEnd
Next
EndIf
EndSwitch
WEndCode : Tout sélectionner
$Process = Run("H:\VueScan\VueScan\vuescan.exe")Merci de votre aide