11-20-2010, 06:09 PM
Function IsEditableTextControlFocused
test
Macro Macro1500
Trigger F12
Tested with simple edit/richedit controls, IE, Firefox and Word 2003.
;/
function# [&caretX] [&caretY] [&caretW] [&caretH] [Acc&aFocus]
;If caret is in an editable text field, returns handle of the control.
;Else returns 0.
;This function works not with all windows/controls.
;caretX ... - optional variables that receive caret location and focused accessible object.
int x y cx cy
int w=GetCaretXY(x y cx cy)
if(!w) ret
Acc a=acc
if(!a.a or a.State&STATE_SYSTEM_READONLY) ret
if(&caretX) caretX=x
if(&caretY) caretY=y
if(&caretW) caretW=cx
if(&caretH) caretH=cy
if(&aFocus) aFocus=a
ret wtest
Macro Macro1500
Trigger F12

out
int w1 x y cx cy; Acc a
w1=IsEditableTextControlFocused(x y cx cy a)
if(!w1) ret
out "%i %i %i %i" x y cx cy
outw w1
a.Role(_s); out _s
a.State(_s); out _s
out a.Name
out a.ValueTested with simple edit/richedit controls, IE, Firefox and Word 2003.
