Jump to content

STDout and a-Squared


Recommended Posts

Hi!

I'm trying to create a GUI for a-squared command line scanner, using STDoutread to output information.

So far i managed to create a GUI that works with DOS command (dir /s for example).

With antivirus programs like a-squared or Mcafee that output sometimes using a single line, my GUI fails to do so.

CODE
#include <GuiConstants.au3>

#include <Constants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#include <StaticConstants.au3>

#include <misc.au3>

#include <EditConstants.au3>

;Tray Icon Config

Opt("TrayMenuMode", 1)

Opt("TrayOnEventMode", 1)

Opt("TrayAutoPause", 0)

TraySetToolTip("Backup Automatico")

AutoItSetOption("TrayIconHide", 0)

$Main = GUICreate("", 788, 320, -1, -1)

;GUISetBKColor(0xE0FFFF)

GUISetBKColor(0xffFFFF)

$label=GUICtrlCreateLabel("BACKUP AUTOMATICO", 0, 8,788,28, $SS_CENTER)

GUICtrlSetFont($label,18,800,0,"Arial")

GUICtrlCreatePic("pcc.bmp", 738, 2, 44, 42)

$cancel=GUICtrlCreateButton ("Cancelar",372,278,66,30)

Dim $EditBufSize = 50000000

$run= GUICtrlCreateEdit("", 4, 44, 780, 220,BitOR($ES_OEMCONVERT,$WS_VSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY))

GUICtrlSetFont($run,6,800,0,"Terminal")

GUICtrlSendMsg ($run, $EM_SETLIMITTEXT, $EditBufSize, 0)

GUISetState(@SW_SHOW)

Sleep(800)

$sr1 = IniRead(@ScriptDir & "\config.ini", "1", "source", "")

$tg1 = IniRead(@ScriptDir & "\config.ini", "1", "target", "")

Global $foo = Run(@ComSpec & " /c a2cmd /deep",@ScriptDir, @SW_HIDE, $STDOUT_CHILD)

Global $line

While 1

$line = StdoutRead($foo,0,0)

If @error Then ExitLoop

GUICtrlSetData($run,$line,1)

$msg = GUIGetMsg()

if $msg=$cancel Then

$PID = ProcessExists("a2cmd.exe")

If $PID Then ProcessClose($PID)

exit

EndIf

if $msg=$GUI_EVENT_CLOSE Then

$PID = ProcessExists("a2cmd.exe")

If $PID Then ProcessClose($PID)

exit

EndIf

Wend

GUICtrlSetData($cancel,"Sair")

Do

$msg = GUIGetMsg()

Select

Case $msg=$cancel

exit

EndSelect

Until $msg = $GUI_EVENT_CLOSE

A-Squared command line scanner can be downloaded in:

http://download1.emsisoft.com/a2cmd.zip

Does anyone know what i'm doing wrong?

Thanks in advance!

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...