0

I have the following code to have a BHO for Windows Explorer. How can I change it to work only with Windows Explorer instead of Internet Explorer?

Thanks

[
ComVisible(true),
Guid("8a194578-81ea-4850-9911-13ba2d71efbd"),
ClassInterface(ClassInterfaceType.None)
]
public class BHO:IObjectWithSite
{
      WebBrowser webBrowser;
      public void OnDocumentComplete(object pDisp, ref object URL)
      { 
          System.Windows.Forms.MessageBox.Show("Hi");
      }

      public int SetSite(object site)
      {
        if (site != null)
        {
            webBrowser = (WebBrowser)site;
            webBrowser.DocumentComplete += new DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete);
        }
      }

      public int GetSite(ref Guid guid, out IntPtr ppvSite)
      {
        IntPtr punk = Marshal.GetIUnknownForObject(webBrowser);
        int hr = Marshal.QueryInterface(punk, ref guid, out ppvSite);
        Marshal.Release(punk);

        return hr;
      }
 }
Kara
  • 6,115
  • 16
  • 50
  • 57
pinker
  • 1,283
  • 2
  • 15
  • 32
  • It does not appear to make sense having a browser plugin for a non-browser. Can you add more details to your question? – nvoigt Mar 04 '14 at 14:47
  • According to documentation it seems that if I want to add a custom panel to Windows Explorer my class must inherit IObjectWithSite. My goal is to create a new panel like here http://i.stack.imgur.com/vKZgc.png – pinker Mar 04 '14 at 14:53
  • @nvoigt: Explorer is also browser, you misunderstood definition of browser. – Xearinox Mar 04 '14 at 16:51
  • @pinker: In C/C++ is this simple, but in C# I dont know nothing. – Xearinox Mar 04 '14 at 16:52
  • @Xearinox can you please explain me how to do it in C++? I don't mind to do it in C++. Thanks a LOT! – pinker Mar 04 '14 at 18:51
  • See my answer this: http://stackoverflow.com/questions/17956272/get-explorer-exe-to-load-my-extension-from-startup – Xearinox Mar 04 '14 at 18:58
  • Thanks @Xearinox. I am not quite an expert in C++. There is some basic code in C++ that simply displays a message when the explorer is loaded? Thanks once again. – pinker Mar 04 '14 at 19:27
  • No there is code that denied iexplore.exe to load. – Xearinox Mar 04 '14 at 19:33
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/49003/discussion-between-pinker-and-xearinox) – pinker Mar 04 '14 at 22:26

0 Answers0