none
C#如何随时捕获IE浏览器关闭事件 RRS feed

答案

  • 可以捕获DWebBrowserEvents2::OnQuit事件。



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    2010年9月25日 20:12
    版主

全部回复

  • 可以捕获DWebBrowserEvents2::OnQuit事件。



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    2010年9月25日 20:12
    版主
  • 如果你在WINFORM中使用webbrower来进行捕捉,
    参照:http://www.chenjiliang.com/article/View.aspx?ArticleID=2284


    http://blog.csdn.net/zx13525079024
    2010年9月26日 8:23

  • private void button1_Click(object sender, EventArgs e)
     {
     this.timer1.Enabled = true;
     }
    
     void ie_OnQuit()
     {
     
     }
    
     private void timer1_Tick(object sender, EventArgs e)
     {
     SHDocVw.ShellWindowsClass shellWindows = new SHDocVw.ShellWindowsClass();
    
     string filename = string.Empty;
     foreach (SHDocVw.InternetExplorer ie in shellWindows)
     {
     filename = Path.GetFileNameWithoutExtension(ie.FullName);
     if (filename.Contains("iexplore"))
     {
    
     if (ie.Type.Contains("Excel"))
     {
     ie.OnQuit += new DWebBrowserEvents2_OnQuitEventHandler(ie_OnQuit);
     }
    
     }
     }
     }
    
     private void button2_Click(object sender, EventArgs e)
     {
     this.timer1.Enabled = false;
     }

    我想捕获IE里打开的Excel对象,其实我做的是一个监控程序,监控打开的Excel,请问通过这个IE对象能获取打开的Excel对象吗?IE浏览器里的Excel对象是Java程序写的用流输出的。
    2010年9月26日 11:30