文字間位置のXY座標を取得します。
#Include <GuiRichEdit.au3>
_GUICtrlRichEdit_GetXYFromCharPos($hWnd, $iCharPos)
パラメータ
| $hWnd | コントロールのハンドル | 
| $iCharPos | 文字間位置 | 
返し値
| 成功: | 配列 [<x>, <y>] - 文字間位置の座標はクライアント領域の左上隅に対する相対値です。 | 
| 失敗: | @errorを設定します。 | 
| @error: | 101 - $hWndがハンドルではありません。 | 
| 1021 - $iCharPosが正の数でもゼロでもありません。 | |
| 1022 - $iCharPosがコントロール内の文字数を超えています。 | 
注意
最初の文字の文字間位置は0です。
関連
_GUICtrlRichEdit_GetCharPosFromXY
こちらも参照
MSDNライブラリでEM_POSFROMCHARを検索して下さい。
例
#AutoIt3Wrapper_Au3Check_Parameters= -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiRichEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $lblMsg, $hRichEdit
Main()
Func Main()
    Local $hGui, $hRichEdit, $iMsg, $ai, $btnNext, $iStep = 0
    $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName,4) &")", 320, 350, -1, -1)
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _
            BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL))
    $lblMsg = GUICtrlCreateLabel("", 10, 235, 300, 60)
    $btnNext = GUICtrlCreateButton("Next", 270, 310, 40, 30)
    GUISetState()
    _GuiCtrlRichEdit_AppendText($hRichEdit, @CR & "This is appended text.")
    While True
        $iMsg = GUIGetMsg()
        Select
            Case $iMsg = $GUI_EVENT_CLOSE
                GUIDelete()
                Exit
            Case $iMsg = $btnNext
                $iStep += 1
                Switch $iStep
                    Case 1
                        $ai = _GuiCtrlRichEdit_GetXYFromCharPos($hRichEdit, 20)
                        Report("1.The coordinates of inter-character position 20 are (" & $ai[0] & "," & $ai[1] & ")")
                    Case 2
                        Report("2.The inter-character position at or nearest coordinates (" & $ai[0] & "," & $ai[1] & ") is " & _
                                _GuiCtrlRichEdit_GetCharPosFromXY($hRichEdit, $ai[0], $ai[1]))
                        GUICtrlSetState($btnNext, $GUI_DISABLE)
                EndSwitch
        EndSelect
    WEnd
EndFunc   ;==>Main
Func Report($sMsg)
    GUICtrlSetData($lblMsg, $sMsg)
EndFunc   ;==>Report