bho

Calling C# BHO methods from Javascript

♀尐吖头ヾ 提交于 2019-12-17 18:10:12
问题 I'm trying to figure out how to call C# methods in my BHO object from Javascript within the page. I found numerous pages on how to do it in C++/ATL/Com such as: Browser Helper Objects and Scripts Options Calling BHO method from Javascript? I have tried to follow along and implement it correctly in C#, but I can't get it to work probably due to some obvious COM problems that I have which I don't fully understand. I am using C# 4.0. Here are the relevant parts of the code: using SHDocVw; using

IE's zone elevation protection interferences functionality of BHO

六月ゝ 毕业季﹏ 提交于 2019-12-13 04:57:47
问题 I am developing a Browser Helper Object (BHO) for Internet Explorer written in C#. I use the BeforeNavigate event to get a called URL and save it into a local variable. For every tab a new BHO instance is spawned. This means that every tab has it's own BHO which in turn have own local variables. I have checked this by displaying a MessageBox with the previous called URL (the value of the local variable) before it is overwritten with the new URL. string myUrl = ""; void BeforeNavigate( string

change LAN proxy

我只是一个虾纸丫 提交于 2019-12-12 13:59:07
问题 I want to enable proxy from BHO for only Internet Explorer or if that is not possible at least set proxy for LAN. After the below code is executed nothing happen, proxy is not changed and not enabled. I want to change proxy settings when a user visit a website, and Idealy will be if it is possible to enable proxy only for internet explorer, so other programs can work normaly with direct connection which not need proxy, so if it is possible to set proxy only for internet explorer please tell

How to write simple background thread in CWorkerThread

微笑、不失礼 提交于 2019-12-12 09:02:00
问题 I'm trying to asynchronously run function in my add-on for Internet Explorer (I'm writing BHO in VC++). As suggested here I'm trying to use CWorkerThread. I've been trying to figure it out for hours but still have no idea how to do it. I don't have much experience in ATL. The lack of a good documentations or tutorials on Internet is killing me. I'm creating class by Add->Class and choosing ATL Simple Object (that's how you add classed to ATL project right?). But how to implement this

Exposing methods to JS on a CAxWindow from a BHO ( C++ )

江枫思渺然 提交于 2019-12-12 05:04:21
问题 I have this BHO which I successfully exposed method to JS from it using this thread: Calling BHO method from Javascript?. When I open a CAxWindow in order to host HTML docs, I'd like to use this exported method but it seems that it doesn't work for that window as well. I tried to make a custom class like: class Bubble: public CAxWindow, public IDispEventImpl<1, Bubble, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 0> { public: BEGIN_SINK_MAP(Bubble) SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2,

Internet Explorer BHO check for multi-instance of site

放肆的年华 提交于 2019-12-11 23:49:01
问题 I'm working on a project for a client. We are building an internal web portal, and for various (mostly political) reasons have ended up building a BHO for IE8. One of the things t does is make sur that only one instance of the portal can be opened at once. It does this by writing a temp file when the portal is opened. Unfortunately this is not optimal as if IE crashes for any reason then the next time the portal is fired up, the user is left staring at an "unauthorised" message until the

Accessing resources in registered .NET DLL via res protocol

落花浮王杯 提交于 2019-12-11 23:25:08
问题 I have a .NET DLL that I register with regasm.exe as a Browser Helper Object. I embedded several Win32 resources in the DLL using .res files and /win32 switch to csc.exe. image.png HTML "image.png" I am able to access the resources using the res protocol as long as I include the absolute path of the DLL . res://C:\Path\To\My\Dll\Assembly.dll/image.png This is rather unfortunate. I would much rather just reference the assembly name as I have seen in many other examples: res://Assembly.dll

SetWinEventHook crahes IE when used in BHO (Browser Helper Object)

主宰稳场 提交于 2019-12-11 17:39:52
问题 I have a C# BHO which sets a hook so that I can track when IE gets focus: public class BHO : IObjectWithSite, IOleCommandTarget { delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime); const uint WINEVENT_OUTOFCONTEXT = 0; const uint EVENT_SYSTEM_FOREGROUND = 3; [DllImport("user32.dll")] static extern bool UnhookWinEvent(IntPtr hWinEventHook); [DllImport("user32.dll")] static extern IntPtr

Unable to start program ATL Project C++

别说谁变了你拦得住时间么 提交于 2019-12-11 07:44:40
问题 I am trying to create a BHO with the ATL Project in Visual Studio 2010. I have been following this article: http://msdn.microsoft.com/en-us/library/bb250489(v=vs.85).aspx The project builds successfully however I get an error popup with an ambiguous "Unable to start program 'C:\ .... MyProject.dll'" My BHO just has the bare bones code, I've only added what was mentioned in the article until it says to build for the first time so most of it is auto generated. Anyone run into this? Thanks! 回答1:

IE BHO written in C# 4.0 is working in IE 9 but not working in IE10 on a windows 7 machine

眉间皱痕 提交于 2019-12-11 03:35:58
问题 I have written a BHO by following " How to get started with developing Internet Explorer extensions?. " and it worked very well for me in IE8 and IE9 . But the same is not working in IE10 and above. Are there any differences between IE9 and IE10 in terms of BHO code. Any help is appreciated. Thanks 回答1: Yes, though without more information about the problems you're running into with IE10, it's hard to what specific information to point you to. Here are a couple of links to get you started: