Jump to content

need code to set text in edit box


Recommended Posts

Here an example:

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

Global $iMemo
$hGUI = GUICreate("Test", 640, 480)
$iMemo = GUICtrlCreateEdit("", 0, 0, 640, 480, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_READONLY)
GUICtrlSetLimit(-1, 0x7FFFFFFF)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()

$prg = "dir "
$parameter = @SystemDir & " /s"
$run = Run(@ComSpec & " /c " & $prg & $parameter, @ScriptDir, @SW_HIDE, $STDOUT_CHILD)

While 1
    $line = StdoutRead($run)
    If @error Then ExitLoop
    MemoWrite($line)
Wend

While 1
    $Msg = GUIGetMsg()
    If $Msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

$save = MsgBox(4 + 32 + 256, "Save", "Save log?", 10)
If $save = 6 Then
    $file = FileSaveDialog("Save Log", @ScriptDir, "Log (*.log;*.txt)", 18)
    If Not @error Then
        $log = GUICtrlRead($iMemo)
        FileWrite($file, $log)
        FileClose($file)
    EndIf
EndIf
Exit

; Write a line to the memo control
Func MemoWrite($sMessage)
;~  GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
    GUICtrlSetData($iMemo, $sMessage, 1)
EndFunc ;==>MemoWrite

BR,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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...