

; Returns the caret position of the editor [.hEditor]
;  EAX - X position from 1
;  EDX - Y position (line number) from 1
proc GetEditorCaretPos, .hEditor
.aepos AEPOS
begin
        push    ecx
        lea     eax, [.aepos]
        invoke  SendMessageW, [.hEditor], AEM_GETPOS, eax, 0
        mov     eax, [.aepos.caretPosition]
        mov     edx, [.aepos.caretLine]
        pop     ecx
        return
endp


