May 07, 2024, 07:36:58 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Disabling CSS in webbrowser

Started by sapero, April 24, 2009, 08:34:40 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sapero

April 24, 2009, 08:34:40 AM Last Edit: April 24, 2009, 08:37:23 AM by sapero
This example shows how to disable cascading shyle sheets (downloading and applying). To be honest, it forces the webbrowser to use a blank css file for all webpages, from your harddrive. Ths is the equivalent for IE accesibility options, but is local, to your application only.

The core code is placed in custom IDocHostUIHandler2 class, in CDHUIHandler2::GetOverrideKeyPath method. This method returns registry path other than the defaultHKEY_CURRENT_USER/Software/Microsoft/Internet Explorer
You'll find here DisableCss(BOOL) subroutine. It creates a registry key with few browser options, and tells to the browser to load it from this key by sending WM_SETTINGCHANGE message to hidden "Internet Explorer_Hidden" window.

References:
http://msdn.microsoft.com/en-us/library/aa753274(VS.85).aspx GetOverrideKeyPath
http://msdn.microsoft.com/en-us/library/aa753272(VS.85).aspx ICustomDoc