Thursday, April 10, 2008

MS VS .NET browser trick

I have seen emacs doing just too many things to the point of it being really silly.

I wanted to see if MSVS would also be able to do something special - no matter how silly.

Lets first browse in it: Therefore the first thing I tried was to "Open File" and point it to Google.
(Yes, I know - Ironic: Attempting to access Google from a MSVS IDE.)

Unfortunately this resulted in totally a different outcome. VS opened the HTML page as a text file. This is quite interesting, but not what I want. Lets try again.

Go back to the Open file dialog, type in the address and instead of just clicking Open, lets try clicking the small arrow besides the Open button.
No choices available to load it as a valid HTML page. Hmm, time to look at other options.

How about getting some help from the VS documentation? Lets get some F1!
Now this is interesting - "Online help as primary source"
After selecting this option and waiting for enough time, I see the help page with two drop down toolbars. One of those toolbars is the URL with the typical "ms-help://" address.

Type http://www.google.com/ in there and voila! We have Google in MSVS.

After a little bit of Wireshark digging to find out which browser has been used by MSVS : The User agent string is MSIE7.0

My default browser is Seamonkey, but I'm sure the devs at MS wouldn't be allowed to fire that up in Visual Studio...

This means that VS is firing up Internet Explorer only.
Is it using ActiveX to do this? I dont know yet how to find out.

Conclusion:
Microsoft's Visual Studio IDE's - .NET and above - use IE as the browser, over-riding your default browser settings.
Using IE, you can do all the things a browser does - webmail, Internet radio and so on.

Not exactly emacs, but conceptually similar.

EDIT:
A good friend (Nilesh) pointed out that:
"figuring out whether it uses the IE browser is easy... there is this tool called SPY++ that ships with Visual Studio"

Use VS tools to find out more about VS! Excellent recursive hack!

No comments: