Jump to content

Recommended Posts

Posted (edited)

I was wondering if the experts here might be able to help me with something...

DaveF posted this...

*Note* this code only works with beta.

; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

;If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("STDIO Window", 425, 322,(@DesktopWidth-425)/2, (@DesktopHeight-362)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

; Create a read-only edit control
$eOutput = GuiCtrlCreateEdit("", 0, 10, 423, 260, BitOR($ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY))
; Exit button
$bExit = GuiCtrlCreateButton("Exit", 340, 285, 60, 20)

GuiSetState()
; Run child process and provide console i/o for it.
; Parameter of 2 = provide standard output 
$ourProcess = Run("ping autoitscript.com", @SystemDir, @SW_HIDE, 2)

; Loop and update the edit control unitl we hit EOF (and get an error)
While 1
   If $ourProcess Then
    ; Calling StdoutRead like this returns the characters waiting to be read
      $charsWaiting = StdoutRead($ourProcess, 0 , 1)
      If @error = -1 Then
         $ourProcess = 0
            MsgBox(0, "App Exited", "Process has exited...")
         ContinueLoop
      EndIf
      If $charsWaiting Then
         $currentRead = StdoutRead($ourProcess)
         GUICtrlSetData($eOutput, $currentRead, 1)
      EndIf
   EndIf
   $msg = GuiGetMsg()
   Select
      Case $msg = $GUI_EVENT_CLOSE
         ExitLoop
      Case $msg = $bExit
         ExitLoop
      Case Else
      ;;;
   EndSelect
WEnd
Exit

In this thread: HERE

It will show text from a command window inside of an autoit window instead.

I changed "Ping autoitscript.com" with a batch file of my own.

But for some reason it will not display the full batch.

I suppose it has something to do with a 64KB file size limit or something?

I was wondering if there is anyway to edit this to work that will show my entire script?

Can anyone help me. I have been trying all sorts of stuff but I can't seem to get it to work fully. Is it just not possible?

Edited by Proph
Posted

....tons of rambling stuff and code...

Take a deep breath, and then pls restate concisely and precisely what your issue is. If there's a 64 k limit, it is easily testable , try it w/ test cases smaller and larger. Should you need larger buffer sizes, there's usually a way, from redirecting to a file, finding an alternate method using DllCall(), all the way up to and including asking nicely for a feature request.

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Posted

The 64kb size limit is per-read, if you're using the above script as an example it takes bites of the output up to 64k in size and stores them in the edit box.

When you say it doesn't display the full batch I take that to mean the full output, is it chopped off the end or is there stuff missing from the middle? Is the output data or is there some kind of graphical menu / updated areas / other non-stream-of-characters output?

Are you calling your batch file directly with Run or with @ComSpec /c ( a.k.a. with command /c -or- cmd /c )?

What version of Windows is this on?

Can you tell us what version of the AutoIt beta you're using?

It would really help if you could post the batch file that you're using or enough of it to demonstrate the behavior you're seeing. No need to repost the AutoIt script, we have that from the post above.

If there's a bug then I want to fix it, please help me do that.

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Posted

Thanks for the reply's. Sorry for not posting back quickly.

Would it be ok for me to PM the batch file to you DaveF?

Because the batch file was written by a friend of mine... I am not sure if he would be ok with me posting the source code on a public forum.

I tried to run it with and without @comspec /c. I never tried cmd /c

It is weird... it shows just fine... but then it ends up stopping after a bit. But the batch is still running.

I am using WinXP. I am using the current beta version.

Posted

Sure, I'll look at it as time permits.

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...