Sign in to follow this  
Followers 0
stampy

Finding element focus in IE

3 posts in this topic

While I've been scripting with Autoit for a while (bowing down to it's excellence). I'm new to dealing with IE and IE.au3. I'm trying to find where the focus is on a page. I can activate the element focus with _IEAction, but I need to find the focus, similar to using ControlGetFocus in a GUI. If anyone can give me a push in the right direction I would appreciate it.

Share this post


Link to post
Share on other sites



You can use the hasFocus method to check focus, although I'm guessing you had to go through every element to find which one has focus at the moment. Might be inaccurate by the time it's completed searching. It's used like this:

$focus = $oElement.hasFocus()
If $focus = True Then
    ;has focus
Else
    ;doesn't have focus
EndIf

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]

Share this post


Link to post
Share on other sites

awesome thankyou. I'll give that a shot.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0