Hello,
Thanks for your response. Based on my research, I am able to receive the IE
event on my side. I now share the following information with you:
1. You will need to create a WinForm application instead of Console
application.
2. I reviewed your code, it seems that the delegates are not mapped to
methods. Please refer to the following code snippet:
//--------------code snippet----------------------
public class Form1 : System.Windows.Forms.Form
{
static private SHDocVw.ShellWindows shellWindows = new
SHDocVw.ShellWindowsClass();
public Form1()
{
InitializeComponent();
foreach(SHDocVw.InternetExplorer ie in shellWindows)
{
MessageBox.Show("ie.Location:" + ie.LocationURL);
ie.BeforeNavigate2 += new
SHDocVw.DWebBrowserEvents2_BeforeNavigate2EventHan dler(this.ie_BeforeNavigat
e2);
}
public void ie_BeforeNavigate2(object pDisp , ref object url, ref
object Flags, ref object TargetFrameName, ref object PostData, ref object
Headers, ref bool Cancel)
{
MessageBox.Show("event received!");
}
//----------------end of----------------------------
Please check it on your side.
Have a nice day!
Regards,
HuangTM
Microsoft Online Partner Support
MCSE/MCSD
Get Secure! --
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.