Glyph Posted December 21, 2006 Share Posted December 21, 2006 $a = WinGetCaretPos() If Not @error Then MsgBox(0,"First Method Pos", $a[0], $a[1]) sleep(2000) $b = _CaretPos() If Not @error Then msgbox(0,"Second Method Pos", $b[0], $b[1]) sleep(2000) Func _CaretPos() Local $x_adjust = 5 Local $y_adjust = 40 Opt("CaretCoordMode", 2) Local $c = WinGetCaretPos() ;relative caret coords Local $w = WinGetPos("") ;window's coords Local $f = ControlGetFocus("","") ;text region "handle" Local $e = ControlGetPos("", "", $f) ;text region coords Local $t[2] If IsArray($c) and IsArray($w) and IsArray($e) Then $t[0] = $c[0] + $w[0] + $e[0] + $x_adjust $t[1] = $c[1] + $w[1] + $e[1] + $y_adjust Return $t ;absolute screen coords of caret cursor Else SetError(1) EndIf EndFunc I am so confused.... i made it do a message box.... it's giving me random numbers.... what do these numbers mean? Can anyone explain to me how this works? Help is very appreciated! tolle indicium Link to comment Share on other sites More sharing options...
Valik Posted December 21, 2006 Share Posted December 21, 2006 A message box doesn't have a caret for a start. Link to comment Share on other sites More sharing options...
Glyph Posted December 21, 2006 Author Share Posted December 21, 2006 (edited) -edit- Never mind i got it. Edited December 21, 2006 by backstabbed tolle indicium Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now