aa2zz6

Question about textbox showing each process

6 posts in this topic

#1 ·  Posted (edited)

Greetings, I was wondering if it was possible to code a text box which could display each output done or process completed by the program. Kinda like a log sheet per say but built in the GUI. I googled this idea a few different ways and it didn't return any results. If anyone has any idea please feel free to share. Picture below shows a tab with Log and that's where everything will be recorded. 

 

Untitled.png

Edited by aa2zz6
pic

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Log = GUICreate("", 615, 437, 254, 124)
GUICtrlCreateEdit("", 8, 8, 593, 425)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $LogMessage
;place the processes you want installed in here
    FirstInstallation()
    $LogMessage = "First Installation is done."
    GUICtrlSetData($Log,$LogMessage)
    SecondInstallation()
    $LogMessage = $LogMessage & @CRLF & "Second Installation is done."   
    GUICtrlSetData($Log,$LogMessage)
;end placing the processes you want installed in here

While 1     
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func FirstInstallation()
    ;Do Something
    
EndFunc

Func SecondInstallation()
    ;Do something
EndFunc

I haven't tested this but it should work if you change the processes in the 2 functions.

Edited by computergroove

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks for the reply! I had to switch the variable around in order for it to write out. I'll post the code below.

I also included a  _NowTime() to show when the process was completed.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Date.au3>

#Region ### START Koda GUI section ### Form=
GUICreate("Form3", 413, 298, 303, 219)
$log = GUICtrlCreateEdit("", 56, 40, 185, 89, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $LogMessage
;place the processes you want installed in here
FirstInstallation()
$LogMessage = "First Installation is done."
GUICtrlSetData($log,$LogMessage)

SecondInstallation()
$LogMessage = _NowTime() & $LogMessage & @CRLF & "Second Installation is done."
GUICtrlSetData($Log, $LogMessage)
;end placing the processes you want installed in here

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func FirstInstallation()
    ShellExecute("C:\Program Files (x86)\Malwarebytes Anti-Malware\mbam.exe")
EndFunc   ;==>FirstInstallation

Func SecondInstallation()
    ;Process goes here
EndFunc   ;==>SecondInstallation

 

Edited by aa2zz6
updated

Share this post


Link to post
Share on other sites

My problem with adding a _NowTime() is that the time is together on one line rather than with in the system message. I figured adding it in the front of the $LogMessage would work but it won't.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Date.au3>
#Region ### START Koda GUI section ### Form=
GUICreate("Form3", 413, 298, 303, 219)
$Log = GUICtrlCreateEdit("", 56, 40, 250, 89, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Global $LogMessage
;place the processes you want installed in here
FirstInstallation()
$LogMessage = _NowTime() & $LogMessage & @CRLF & " First Installation is done."
GUICtrlSetData($Log,$LogMessage)

SecondInstallation()
$LogMessage = _NowTime() & $LogMessage & @CRLF & " Second Installation is done."
GUICtrlSetData($Log, $LogMessage)
;end placing the processes you want installed in here

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Func FirstInstallation()
    ShellExecute("C:\Program Files (x86)\Malwarebytes Anti-Malware\mbam.exe")
EndFunc   ;==>FirstInstallation

Func SecondInstallation()
    ShellExecute("C:\Program Files (x86)\Malwarebytes Anti-Malware\mbam.exe")
EndFunc   ;==>SecondInstallation

 

Share this post


Link to post
Share on other sites

$LogMessage will start as a single line item and after every new installation it will add a new line. Try this:

Global $LogMessage
;place the processes you want installed in here
FirstInstallation()
$LogMessage = $LogMessage & @CRLF & _NowTime() & " First Installation is done."
GUICtrlSetData($Log,$LogMessage)

SecondInstallation()
$LogMessage = $LogMessage & @CRLF & _NowTime() & " Second Installation is done."
GUICtrlSetData($Log, $LogMessage)
;end placing the processes you want installed in here

 


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Share this post


Link to post
Share on other sites

Thanks Computergroove. I appreciate the help. 

Share this post


Link to post
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