views:

142

answers:

1

I want to know what are different ways to get the response code information when we visit any page in IE by using Windows API or some interfaces using C++?

I think some ways include

1)Using BHO: But I think that will give HTML information.Can we get information related to HTTP here like response codes?

2)Using Async Pluggable Protocols:

Any other ways ?

Can I use WinInet or WinHttp to get that information?

+1  A: 

You can use API hooks on the functions in WinInet that are used by IE in order to perform HTTP-based communication and by analyzing their parameters and return values you will be able to obtain what you need. There are several API hooking libraries available on the Internet (some of them are free for non-commercial use) - take a look at [madCodeHook][1] or Microsoft Detours (http://research.microsoft.com/en-us/projects/detours/). You can also write your own pluggable protocol for HTTP that will basically wrap the default HTTP protocol for IE. BHO will not help you much, because, as you correctly pointed out, it works on the HTML/DOM level and, to the best of my knowledge, is protocol-agnostic.

David Elkind
Note that API thunking can be very fragile, and wrapping the HTTP protocol using an APP is not recommended due to performance and reliability problems.You may be better off with an external proxy-debugger (e.g. www.fiddler2.com)
EricLaw -MSFT-