What happens when I close my app, which uses webbrowser. The following url uses flash player.
Everything works fine. This error shows on app close. How do I ignore it?
I know it's too late, but I feel I have a smart answer for this issue.
Use this, it's working for me on a fly. :)
webBrowser.ScriptErrorsSuppressed = true;
If it's not working, we can use different methods like showing a confirmation box (Ex: This windows want to close do you want to continue Yes/ No)
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)]
static extern IntPtr FindWindowByCaption(IntPtr ZeroOnly, string lpWindowName);
[DllImport("user32.dll")]
private static extern bool SetForegroundWindow(IntPtr hWnd);
private void TimerPopUp_Tick(object sender, EventArgs e)
{
IntPtr hWnd1 = FindWindowByCaption(IntPtr.Zero, "Web Browser");
if (hWnd1 != IntPtr.Zero && SetForegroundWindow(hWnd1))
{
SendKeys.Send("{Enter}");
}
}
If there are any errors, see this link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With