Bonjour a tous,j'ai trouver ce que je cherché,merci a vous.
Le fait que je veuille que si je lance plusieurs opération a la suite (donc pas simultanément),il a fallu que je fasse ceux ci:
Code : Tout sélectionner
#include <GUIConstants.au3>
$PID = "notepad.exe"
$PID1 = "wordpad.exe"
GUICreate("Stop action en cours", 330, 80, -1, -1)
$button = GUICtrlCreateCheckbox("Lancer notepad", 10, 5, 100, 40, $WS_EX_APPWINDOW)
$button1 = GUICtrlCreateCheckbox("Lancer wordpad", 115, 5, 100, 40, $WS_EX_APPWINDOW)
$exit = GUICtrlCreateButton("Stop action", 220, 5, 100, 40, $WS_EX_APPWINDOW)
$lanceraction = GUICtrlCreateButton("Lancer action", 10, 50, 310, 30)
GUISetState()
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ProcessClose($PID)
ProcessClose($PID1)
ExitLoop
Case $msg = $lanceraction
If BitAND(GUICtrlRead($button), $GUI_CHECKED) Then
ShellExecute($PID)
EndIf
If BitAND(GUICtrlRead($button1), $GUI_CHECKED) Then
While 1
If Not ProcessExists($PID) Then ExitLoop
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ProcessClose($PID)
ProcessClose($PID1)
ExitLoop
Case $msg = $exit
ProcessClose($PID)
ProcessClose($PID1)
Exit
EndSelect
Sleep(0)
WEnd
ShellExecute($PID1)
EndIf
Case $msg = $exit
ProcessClose($PID)
ProcessClose($PID1)
Exit
EndSelect
WEnd
Un peu long a preimere vu,mais en incluant tout dans des fonctions,le tout peut etre beaucoup plus light..