Answered How to use ShellWindows class in IE's Protected Mode?

  • Wednesday, October 12, 2011 7:58 AM
     
      Has Code
                shellWindows = new SHDocVw.ShellWindowsClass();
                int handle = 0;
                handle = GetForegroundWindow();
    
    
                foreach (SHDocVw.WebBrowser ie in shellWindows)
                {
    
                    //find the instance    
                    if (ie.HWND == handle)
                    {
    
                        doc = ie.Document as mshtml.HTMLDocument;
                        if (doc.hasFocus())
                        {
                           
                            break;
                        }
                    }
                }

     

     

     

     

    The code above (for getting current active tab/windows) works fine with IE's protected mode is OFF.

    Please help me if I can bypass the Protected Mode or use an alternative class to deal with it.

    Thanks in advandce.



    • Edited by Mai Khanh Wednesday, October 12, 2011 7:59 AM
    • Edited by Mai Khanh Wednesday, October 12, 2011 8:10 AM Remove some confusing code
    •  

All Replies