Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text box item caret position
#1
Hello again,

Is it possible to get/set caret position in a textbox accessible object?

Thank you,
Cuitino
#2
Maybe this will be useful
http://www.quickmacros.com/forum/showthr...t=Getcaret

Or
Search forum for GetCaretXY
#3
I mean the caret line position, e.g. 4th line from the top of the document
#4
I was attempting to use Scintilla messages (code below) without success. I suspect it only works for the qm editor?
 
Code:
Copy      Help
 
int GoToLineNumber 3
int h = id(15 "Notepad")
SendMessage(h SCI.SCI_GOTOLINE GoToLineNumber-1 0)
#5
Code:
Copy      Help
int LineNumber=10
int w=win("- Notepad" "Notepad")
int c=id(15 w) ;;editable text 'Text Editor'
LineNumber-1 ;;(line numbers start at zero so need to subtract 1)
int ci=SendMessage(c EM_LINEINDEX LineNumber 0);;
SendMessage(c EM_SETSEL ci ci)
#6
That works! thanks a lot!


Forum Jump:


Users browsing this thread: 1 Guest(s)