Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message hook/subclassing

Status
Not open for further replies.

wvufreelancer

Programmer
Jun 8, 2004
11
US
Hello,

Have an ActiveX control and I am trying to use the Win32API so that when the control is run (which contains an Web Browser Control) and messages that come up will be surpressed. I want the control to run and no matter what ignore any dialog boxes that may try to come up. I know it can be done with either message hooks or sub classing i just don't know how. Thanks in advance for any help.
 
You've got to use the SetWindowLong API to change the default WndProc (function that handles messages sent to the object) for the object. Here's a link to a tutorial that does a decent job of explaining it:


In the example they're subclassing the form itself, but since most controls in VB are Windows themselves it works fine for them too. As long as it has a handle and a WndProc you should be able to use this with no problem.

Just as an aside (and because I find this useful when programming APIs), check out


They have a dowloadable (and free) API reference tool that comes in pretty handy. It doesn't have every API out there, but it's got a lot and does a great job giving info on the paramters, etc - they even have examples for most of them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top