Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser problem with opening link in system browser Options
Daniel
Posted: Friday, February 24, 2017 3:23:17 AM
Rank: Member
Groups: Member

Joined: 1/25/2017
Posts: 18
Hello,
When user click on the link in the control then this link should be opened in default system browser (ie,chorme...).
Everything works on W10. I have a problem on WS2012R2.

When system browser is behind my app (not minimized) then the page is loaded but system browser won't bring it to front.

I've prepared an example:
Quote:
using System;
using System.Windows.Forms;

namespace EOLinkTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
webView1.LoadHtml("<html><body><a href=\"https://www.google.com/\" target=\"_blank\">open in new tab </a></body></html>");
}
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("https://www.google.com/");
}
private void webView1_NewWindow(object sender, EO.WebBrowser.NewWindowEventArgs e)
{
e.Accepted = false;
System.Diagnostics.Process.Start(e.TargetUrl);
}
}
}

When I click in the button then browser is bring to front. But when I click on the link in control then I will see browser icon bliking on the taskbar. I have the same behavior with ie and chrome.

Do I use NewWindow method on a wrong way?
I will be happy with any suggestion :)
eo_support
Posted: Friday, February 24, 2017 8:32:40 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
This is normal and we are not aware of any reliable workaround. The root of the issue is Windows restricts when a process can switch another process to foreground. A general rule is the last input event must be either in the process that tries to set foreground process, or in the process to be set to foreground process. In the case of the EO.WebBrowser, the last input event is in the WebView, which belongs to a child process of the foreground process. This should be accepted as valid for the last input event (as Windows 10 does accept it), but Windows 2012R2 does not seem to accept that. Unfortunately we are not aware of any way to get around of this restrictions on Windows 2012R2. Sorry about it!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.