Hello i am making a script. The main problem is that script is looping when process is found. I want that script open only 1 GUI when process it's recognized.
Here is script:
#include <MsgBoxConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
while 1
If ProcessExists("notepad.exe") Then ; Check if the Notepad process is running.
gui1()
Func gui1()
while 1
$oIE = ObjCreate("Shell.Explorer.2")
; Create a simple GUI for our output
GUICreate("Embedded Web control Test", 640, 580, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
GUICtrlCreateObj($oIE, 10, 40, 600, 360)
GUISetState(@SW_SHOW) ;Show GUI
$oIE.navigate("http://www.autoitscript.com")
WEnd
EndFunc ;==>gui
Else
sleep(10000)
endif
WEnd
Thanks for help!