Что не так?:
Код:

#include <GUIConstantsEx.au3>
#Include <Constants.au3>
Global $Stop = False
Opt("TrayAutoPause",0)
Opt("TrayMenuMode", 1)
;Создания диалогового окна
$GUI_Main = GUICreate ( "ProcessControl 1.0", 400, 230, 45, 45, -1 )
$CTRL_btn_stt = GUICtrlCreateButton ( "Start", 20, 155, 80, 23 ) ;Кнопка Start
$CTRL_btn_stp = GUICtrlCreateButton ( "Stop", 110, 155, 80, 23 ) ;Кнопка Stop
$CTRL_btn_ext = GUICtrlCreateButton ( "Exit", 200, 155, 80, 23 ) ;Кнопка Exit
$CTRL_btr_tray = GUICtrlCreateButton ( "Minimizate", 290, 155, 80, 23) ;Кнопка Minimizate
GUICtrlCreatePic ( "resources\pic.bmp", 0, 0, 400, 72)
GUICtrlCreateLabel ( "Введите название процесса в формате *.exe, где * имя.", 30, 80, 350, -1) ;Текст
GUISetState(@SW_SHOW, $GUI_Main)
;Активация кнопки Start (функции ProcessControl)
While 1
$msg2 = GUIGetMsg(1)
Select
Case $msg2[0] = $GUI_EVENT_CLOSE
ExitLoop
Case $msg2[0] = $CTRL_btn_ext
Exit
Case $msg2[0] = $CTRL_btn_stp
$Stop = 15
Case $msg2[0] = $CTRL_btn_stt
ProcessControl()
EndSelect
WEnd
Func ProcessControl()
$i=ProcessWait("Explorer.exe")=0
Do
If $Stop = True Then
$Stop = False
ExitLoop
EndIf
$i=$i+1
ProcessWait("Explorer.exe")
ProcessClose("Explorer.exe")
$PID = ProcessExists("Explorer.exe")
If $PID Then
ProcessClose ($PID)
EndIf
until $i=1111111
EndFunc