mentosan 0 Posted May 4, 2011 (edited) Hi ! Long time no see ! Hello Jos and everybody hard-coder or light-coder ! I'm building an application to get in hand with scripting again. The syntax check went fine but when I run the script I'm receiving ErrorStdOut. Figured out the part of the script which generates the error: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <Constants.au3> GUICreate(" Detect IP's", 180, 120) GUICtrlCreateLabel("Enter the IP range", 10, 17) GUICtrlSetFont(-1, 8, 600) GUICtrlCreateLabel(" . . . X", 49, 57) GUICtrlSetFont(-1, 8, 600) $n1=GUICtrlCreateInput("", 20, 50, 25, 20, $ES_NUMBER) $n2=GUICtrlCreateInput("", 60, 50, 25, 20, $ES_NUMBER) $n3=GUICtrlCreateInput("", 100, 50, 25, 20, $ES_NUMBER) $btn = GUICtrlCreateButton("OK", 60, 80, 60, 20) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn ExitLoop EndSelect WEnd GUICtrlRead ($n1) GUICtrlRead ($n2) GUICtrlRead ($n3) Thanks for any suggestion. Edited May 4, 2011 by mentosan Share this post Link to post Share on other sites
JScript 71 Posted May 4, 2011 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <Constants.au3> GUICreate(" Detect IP's", 180, 120) GUICtrlCreateLabel("Enter the IP range", 10, 17) GUICtrlSetFont(-1, 8, 600) GUICtrlCreateLabel(" . . . X", 49, 57) GUICtrlSetFont(-1, 8, 600) $n1=GUICtrlCreateInput("", 20, 50, 25, 20, $ES_NUMBER) $n2=GUICtrlCreateInput("", 60, 50, 25, 20, $ES_NUMBER) $n3=GUICtrlCreateInput("", 100, 50, 25, 20, $ES_NUMBER) $btn = GUICtrlCreateButton("OK", 60, 80, 60, 20) GUISetState() $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn ExitLoop EndSelect WEnd GUICtrlRead ($n1) GUICtrlRead ($n2) GUICtrlRead ($n3) Thanks for any suggestion. I executed this script and it worked normal! Did not understand what you want... http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)Somewhere Out ThereJames IngramDownload Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere! Share this post Link to post Share on other sites
mentosan 0 Posted May 4, 2011 Yeah, it is all right. Sorry for that. I'm facing another issue. My script will open a DOS cmd window in hidden mode. I'm using for that: Run(@ComSpec & " /c " & $command, "", @SW_HIDE) The problem is when i want to close the script from running, the DOS cmd will remain active. I could use AdlibRegister to define a function to check if the process of the script is being alive. But then, If I open another DOS cmd window, and I close my application, all DOS cmd windows will be closed too (cmd.exe processes). I just want to be able to close the DOS cmd window related to my script (the hidden one). Do you have any solution on this ? Thanks Share this post Link to post Share on other sites
smartee 14 Posted May 5, 2011 Yeah, it is all right. Sorry for that. I'm facing another issue. My script will open a DOS cmd window in hidden mode. I'm using for that: Run(@ComSpec & " /c " & $command, "", @SW_HIDE) The problem is when i want to close the script from running, the DOS cmd will remain active. I could use AdlibRegister to define a function to check if the process of the script is being alive. But then, If I open another DOS cmd window, and I close my application, all DOS cmd windows will be closed too (cmd.exe processes). I just want to be able to close the DOS cmd window related to my script (the hidden one). Do you have any solution on this ? Thanks hi mentosan, Search the help file for OnAutoItExitRegister(). Here is an example pertinent to your question:OnAutoItExitRegister("CloseChildProcesses") $Notepad=Run(@WindowsDir & "\Notepad.exe", "", @SW_MAXIMIZE) Sleep(5000) ;So you get to see that it has been opened Exit Func CloseChildProcesses() ProcessClose($Notepad) EndFunc Hope this helps -smartee Share this post Link to post Share on other sites