> I've checked around a bit (research on the net, scanning through available
> COM references in VB, etc) and I've not found anything that may do what you
[quoted text clipped - 4 lines]
> looking around for a "Internet Explorer COM class" or something like that.
> Good luck mate, but I don't like your chances.
Hi David and thanks for your comments. I know for a fact that BHO exist. If
you know Google toolbar, this is an BHO.
Take a look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebgen/html/b
ho.asp
But it is hard to build one in VB (it can be done, but that is not the
subject of this discussion). My question is about how difficult it would be
to build one in C, that can talk to my VB program. E.g. If the BHO notices a
user click a form button, how can it send that event to my VB program in a
reliable way.
Kind regards
Dave
Frank Adam - 29 Sep 2004 10:20 GMT
>> I've checked around a bit (research on the net, scanning through available
>> COM references in VB, etc) and I've not found anything that may do what
[quoted text clipped - 19 lines]
>user click a form button, how can it send that event to my VB program in a
>reliable way.
It should not be very difficult at all, once you decide on a suitable
exchange mechanism.
For instance..
You can hook a VB form and gather it's messages before the form gets
to them. Then define a value, say, WM_APP + 100, for a particular
message. From WM_APP up to, if i recall, 0xbfff are messages that are
always available to an application.
So if you have defined WM_APP to flag as a URL_CHANGE event (both in
the C app and the VB app of course), then you simply SendMessage that
to your VB app, with lParam pointing to the buffer holding the URL on
the C side. The VB app's custom WindowProc then runs through a switch,
finds that it is a URL_CHANGE event and peels the String out of the
buffer using CopyMemory and sticks it wherever it wants to, then
return False and sinks the message from the Form. Done.
Another way is if your VB app has a Multiline text window, the C side
(after using FindWindow to get a handle to it) then can just send the
message straight to the text window. The Text_Change event should then
trigger and all should be well.
There are other ways too, like using WM_COPYDATA and you could even
cheat and mimic a MouseMove event, but that is getting a bit nasty. :)

Signature
Regards, Frank
> I've checked around a bit (research on the net, scanning through available
> COM references in VB, etc) and I've not found anything that may do what you
> want. Thinking about it I don't see how many web browsers would allow this,
> as it would result in a TOTAL lack of privacy for the user.
Yes. And that's exactly what MS has done with IE. In the
WinXP SP2 update there's apparently an addded feature
to control BHOs and browser Extensions, but other than that
it's a big and well-known problem that the average user is
entirely unaware of. A lot of companies sneak
a BHO onto the machine along with various free software.
(I imagine that's probably how things like Gator work.)
The only way for a user to know about it is to hand-check
in the Registry.
The BHO then has full access to the IE DOM. IE loads them
automatically as long as the Registry settings are there. BHOs
are typically used for things like targetted adverting, but theoretically
there's no reason that they can't do something like change every
instance of "Kerry" in a page to "Bush", or vice versa.
BHOs are one of the long list of reasons that one should
not use IE online.