Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: cursor position caret position
It's easy to get the mouse cursor position, (see example below) but it's not all that useful. What you probably *really* want is the position of the caret. That's usually the vertical line telling you where characters will go when you type.
The usual method is to set the caret where you want it (by some method - MouseClick maybe - good luck) and then proceed from there.
This script finds the position of the Cursor/Caret on the screen, but... beware... it doesn't really work (see caveat in question #2/answer below):
;Get (useless) cursor position dllcall ;this is for 32 bit Windows only, finds the position of the Cursor/Caret on the screen winactivate("~Notepad") delay(2) bb=binaryalloc(20) binaryeodset(bb,20) mydll=strcat(dirWindows(1),"user32.dll") err=dllcall(mydll,long:"GetCaretPos",lpbinary:bb) x=binarypeek4(bb,0) y=binarypeek4(bb,4) binaryfree(bb) display(5,"Cursor(Caret) Positions","Horizontal %x%%@CRLF%Vertical %Y%") ;message("",err) ;-------for debugging purposes
Depending on your emulation program, it is usually better to directly use the API it supports. Most terminal emulation programs for mainframe access support EHLLAPI or subsets of it. Otherwise, you need to use the script language supported by your emulation program. If it have neither, your should consider getting a better emulation program!
Article ID: W13295
Filename: Find Cursor -Caret- position on screen.txt
File Created: 1999:04:15:16:53:04
Last Updated: 1999:04:15:16:53:04