Richard2000
asked on
Determining focus of IWebBrowser2
Hi,
I am writing IE extensions as a COM tool band and a BHO (Browser Helper Object). I need to determine if the web browser has the focus or not. I already have access to the IWebBrowser2 interface, so I really just need a simple function like this to return the focused state of the specified web browser:
function WebBrowserFocused(IE: IWebBrowser2): Boolean;
It should return True when the user is within the page and capable of interacting with it, False otherwise (for example when the user is in the address bar or within a tool band).
Could you please provide the code to implement this?
I've looked at the IWebBrowser2 reference below, but I'm still unsure of how to determine the focus:
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/reference/ifaces/iwebbrowser2/iwebbrowser2.asp
Thanks in Advance,
Richard
I am writing IE extensions as a COM tool band and a BHO (Browser Helper Object). I need to determine if the web browser has the focus or not. I already have access to the IWebBrowser2 interface, so I really just need a simple function like this to return the focused state of the specified web browser:
function WebBrowserFocused(IE: IWebBrowser2): Boolean;
It should return True when the user is within the page and capable of interacting with it, False otherwise (for example when the user is in the address bar or within a tool band).
Could you please provide the code to implement this?
I've looked at the IWebBrowser2 reference below, but I'm still unsure of how to determine the focus:
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/reference/ifaces/iwebbrowser2/iwebbrowser2.asp
Thanks in Advance,
Richard
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.