Closed GoogleCodeExporter closed 8 years ago
Please refer to the link below for a solution. This will be part of next
release.
http://groups.google.com/group/csexwb/browse_thread/thread/321583125a16a959
Regards,
MH
Original comment by mehr...@gmail.com
on 10 Jan 2008 at 4:54
Confirm. Also have this bug. Windows XP + SP3. Version 1.0.0.7.
Original comment by sec....@gmail.com
on 12 May 2008 at 8:35
This fix does not always work as the clicked link may be a sub component of the
current one with focus, for example if it is in an IFrame.
Original comment by tal13...@gmail.com
on 7 Jul 2008 at 8:44
Here is the fix that will account for frames or iframes:
1) Add next two methods to the "#region Public Method Members" of csEXWB.cs
file
/// <summary>
/// Calls click method of active element
/// </summary>
public void ClickActiveElement()
{
IHTMLElement elem = this.GetActiveElement();
if (elem != null)
elem.click();
}
/// <summary>
/// Attempts to return active IHTMLElement interface instance
/// Accounts for Frames and Iframes
/// </summary>
/// <returns></returns>
public IHTMLElement GetActiveElement()
{
IHTMLElement elem = null;
string tagname = string.Empty;
IHTMLDocument2 doc2 = GetActiveDocument();
if (doc2 != null)
elem = doc2.activeElement;
if( (elem != null) && (!string.IsNullOrEmpty(elem.tagName)) )
tagname = elem.tagName.ToLower();
while ((!string.IsNullOrEmpty(elem.tagName)) &&
((tagname == "frame") || (tagname == "iframe")))
{
//Cast it to IWebBrowser2
IWebBrowser2 pwb = elem as IWebBrowser2;
if (pwb != null)
{
//Now get the document
//If you attempt to access the document via
IHTMLFrameBase2.contentWindow
//you will get a "Access Denied" exception
IHTMLDocument2 pdoc2 = pwb.Document as IHTMLDocument2;
if (pdoc2 != null)
elem = pdoc2.activeElement;
if ((elem != null) && (!string.IsNullOrEmpty(elem.tagName)))
tagname = elem.tagName.ToLower();
else
tagname = string.Empty;
}
}
return elem;
}
2) In "case WindowsMessages.WM_LBUTTONUP:" of WndProc method of IEServerWindow
class
(csEXWB.cs) change
if (!browser.m_InternalHasFocus)
{
browser.Focus();
}
To:
if (!browser.m_InternalHasFocus)
{
browser.Focus();
browser.ClickActiveElement();
}
This issue was resolved in V2.0.0.1
Regards,
MH
Original comment by mehr...@gmail.com
on 7 Jul 2008 at 10:49
Original issue reported on code.google.com by
david.kr...@gmail.com
on 10 Jan 2008 at 3:40