Hallo BurakSZ,
mach es doch einfach so:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiRichEdit.au3>
$Form1 = GUICreate("Beispiel", 306, 106, 192, 124)
$Edit1 = _GUICtrlRichEdit_Create($Form1, StringFormat("Es war ein mal ein Hase, der sehr \r\nböse war."), 8, 8, 185, 89)
$Label1 = GUICtrlCreateLabel("Position von 'Hase':", 200, 8, 103, 17)
$Label2 = GUICtrlCreateLabel("19/23", 232, 32, 33, 17)
$Button1 = GUICtrlCreateButton("'Hase' Position", 208, 64, 83, 25)
GUISetState(@SW_SHOW)
OnAutoItExitRegister("_Exit")
While 1
$msg = GUIGetMsg()
If $msg = -3 Then Exit
If $msg = $Button1 Then
MsgBox(0,"Position", _FunktionUmPositionHerauszufinden())
EndIf
WEnd
Func _Exit()
_GUICtrlRichEdit_Destroy($Edit1)
GUIDelete($Form1)
EndFunc
Func _FunktionUmPositionHerauszufinden()
_GUICtrlRichEdit_GotoCharPos($Edit1,1)
Return(_GUICtrlRichEdit_FindText($Edit1,"Hase",True,False,True))
EndFunc
mfg (Auto)Bert