Function Reference


_GUICtrlEdit_InsertText

Insert text

#include <GuiEdit.au3>
_GUICtrlEdit_InsertText($hWnd, $sText [, $iIndex = -1])

Parameters

$hWnd Control ID/Handle to the control
$sText String to insert
$iIndex [optional] Character position to insert

Return Value

None.

Remarks

None.

Related

_GUICtrlEdit_AppendText

Example


#include <GuiEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Debug_Ed = False ; Check ClassName being passed to Edit functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
    Local $hEdit
    Local $Wow64 = ""
    If @AutoItX64 Then $Wow64 = "\Wow6432Node"
    Local $sFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $Wow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\include\changelog.txt"

    ; Create GUI
    GUICreate("Edit Insert Text", 400, 300)
    $hEdit = GUICtrlCreateEdit("", 2, 2, 394, 268, BitOR($ES_WANTRETURN, $WS_VSCROLL))
    GUISetState()

    ; Set Margins
    _GUICtrlEdit_SetMargins($hEdit, BitOR($EC_LEFTMARGIN, $EC_RIGHTMARGIN), 10, 10)

    ; Set Text
    _GUICtrlEdit_SetText($hEdit, FileRead($sFile))

    ; Insert text
    _GUICtrlEdit_InsertText($hEdit, "*** Excellent UDFs ***" & @CRLF & @CRLF, 0)

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main