AlexCr

Hi,

I like to go in and out of "accessibility" mode for certain web pages (if the text is too small or I don't like the background color). I do that by "manually" going to the main IE menu and selecting Tools / Internet Options / General tab / Accessibility. Then I check or uncheck the check-boxes.

I'd like to write a toggling toolbar button to do that. I have a working toolbar with source, from here:

http://www.codeproject.com/csharp/dotnetbandobjects.asp df=100

But what does my toolbar need to talk to in order to control the accessibility checkboxes in the Internet Options dialog

Thanks,

Alex



Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

IECUSTOMIZER

Hi Alex,

By design the accessibility options are meant to be applied across domains as they are client preferences. You can ignore all server side styling by

enabling "Ignore Font Sizes specified on web pages", "Ignore Font Styles specified on web pages" and using a user stylesheet (don't enable ignore background colors - this will blow away table cell backgrounds and body image backgrounds, regardless of a user stylesheet preferences).

Visit http://www.iecustomizer.com/ url=iethemes and select "Textures" from Category dropdown for examples of how user stylesheets can be installed on a client to negate server side styling of web pages.

Regards.






Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

AlexCr

Hi Rob,

>By design the accessibility options are meant to be applied across domains as they are client preferences. You can ignore all server side styling by enabling "Ignore Font Sizes specified on web pages"...

Thanks for the info.

The key thing I'm looking for is how to do that programatically from code inside my "button press" handler for my toolbar button. Is the website you linked to a good place for that kind of "programmer" level stuff or maybe there is another you can suggest

Thanks,

Alex





Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

IECUSTOMIZER

Hi Alex,

Your BHO or Toolbar has to change the settings in the registry and then refresh(2) the loaded document (object). There may be a method in the mshtml library to do this better than the Refresh2 method of the WebBrowser object (the document refresh is annoying). (See how Internet Options refreshes all InternetExplorer_server( IE, Outlook, VS and other MSIE applications) windows when you apply accessibility or stylesheet changes)

I think a better method is to check the values of these settings when the browser is loaded and then to politly ask your uses if they want to set them, rather than refreshing each page when your uses presses your toolbar button for a page. I would also like to see a test to see if "Display notification about every scripting error" is enabled... this message can be an annoyance when you leave it turned on after a debugging session. (I am working on an application launcher for IE that will do this... I may add accessibility switches now..)

I have some command bar buttons that you may like to download and inspect how they work. They are javascriptlets, but you can use the external.excscript method to implement them in your toolbar.

Toggle Stylesheets - http://www.iecustomizer.com/ url=iebuttons/ txtProvider=111

Toggle Greyscale - http://www.iecustomizer.com/ url=iebuttons/ txtProvider=112

They will show your how to enumerate the tags of the DOM and change their attributes. Be warned... you will be amazed at what a difference blowing away the server stylesheets of some sites will make. Unfortunately, the KISS principle is not universerlly followed. Developers forget that what they design may not be what their users will see and most never bother to code for accessibility.

Regards.






Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

AlexCr

Hi Rob,

Thanks for all the info. I'll check out your javascriptlets.

>most never bother to code for accessibility.

Sadly, quite true in my experience. This always amazes me, since simple "accessibility" (like non-fixed text size and some degree of non-fixed layout and page size) can be useful to a wider range of people (like me) than just those that absolutely require them.

Alex





Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

AlexCr

Hi Rob,

I tried calling Refresh and Refresh2, and although they do cause a refresh, it's not enough to make the changes to the registry entries (like "Always Use My Colors") take effect. I have to _restart_ IE before the changes take effect.

When I do this "manually" with IE's menus (Tools / Internet Options / Accessibility... etc) the changes take effect without having to restart IE. Any idea what IE does in addition to Refresh / Refresh2 to make the change without a restart

Thanks,

Alex





Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

IECUSTOMIZER

Hi Alex,

Yes, you have to restart IE for the registry changes to take effect as IE caches the settings upon start up.

There's a reload method in the mshtml library, but I am unsure if this is how Internet Settings refreshes the browser. I just had a look at inetcplc.dll(the satellite dll to inetcpl.cpl) but it does not have any public methods or an api interface.

Try using 2 or 3 as your paremeter for the Refresh2 method.

Also check that you are not running Toolbarnotifier.exe (the google toolbar registry changes stopper and call google'r) or any other software that may be blocking changes to IE Registry settings. There is a tool RegMon.exe that you can download (do a search for it) that will tell you which applications are accessing IE settings in the registry.

Hold it... I haven't tried it but try

ExecWB OLECMDID_REFRESH, OLECMDEXECOPT_DODEFAULT

or

OLECMDID_PREFREFRESH (I had a look at some old code I had and this line was commented out)

I tried the same thing long ago, but gave up and just did a browser(s) reload instead. I think the solution lies in finding out how inetcpl.cpl manages to refresh all IE windows without reloading the browser. From memory I think that IE5 refresh method worked but that from v6 onwards, the registry settings were being cached and that you had to reload the browser to get it to read the registry values again, but obviously there must be a method that inetcpl.cpl uses.

Sorry I don't have a definitive answer, but if you find one I sure would like to know.

Regards.






Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

Alan Cobb

>... I sure would like to know.

Here is a way that has worked for me on IE7...

You can use WinDbg to see what INETCPL.CPL does after you change some settings. It ends up posting an apparently undocumented 0x0552 message back to a hidden top level window maintained by IE. You can see that window with Spy++. It's window class name is "Internet Explorer_Hidden". So to get IE to do a comprehensive refresh, including the effects of registry settings changes (at least the ones I tried), without needing to restart IE, you can emulate what INETCPL.CPL does and just call PostMessage sending a 0x552 message to the hidden IE window.

A wrinkle is that one IE process can have more than one instance of this same class of hidden top-level window. Also, you might have multiple separate IE processes running or other processes (like dexplore.exe the Visual Studio document explorer) that use the IE DLLs to show HTML content. To tell them all to do the comprehensive refresh I just put in a loop using FindWindowEx looking for all the top level windows with that window class name. I post the same 0x552 message to all of them and they all refresh OK.

If you try it, let us know if it works for you.






Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

DonG2

Hello IECUSTOMIZER,

I checked out a few of your buttons but several of the ones I tried (Toggle Stylesheets, View Source, DOM Explorer) DO NOT WORK in IE7.

It would be a great help if your site listed the versions of IE that your add-ons (buttons, menus, etc.) actually work in, to save all visitors a lot of grief and time.

Thanks.






Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

IECUSTOMIZER

Hi Don,

All are tested on Win 2k, XP and Vista. It may be that the command bar buttons are not appearing in the selection list where you expect them to be (a IE7 feature). Add the newly installed command bar button by selecting 'Customize Command Bar>Add/Remove Command Bar buttons' from the toolbar context menu.

You will find the source button scripts in the install directory. I would be interested to hear if my buttons realy don't work on your 'puter.... yes Button installation on IE7 is different from IE6, but there are few exceptions where buttons developed for IE5-6 do not work in IE7.

I do not force them to appear on the command bar after installation, as it is a users perogerative to choose the appearance and positioning of buttons on their command bar.

Regads.






Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

IECUSTOMIZER

Hi Alan,

Thanks a million for the tip. I took out my Spy++ and set it up and ureka... yep.... so thats how's it done. I am still going through testing and I think I will have to tweak some methods but it is so-far working like a charm.

Regards.






Re: Internet Explorer Extension Development Best way to tweak accessibility settings from a toolbar button?

IECUSTOMIZER

Hi Alex,

Could you please mark Alan Cobbs post as the answer to your question. It works like a charm.

I was fooled for a while because I could not find the 'Internet Explorer_Hidden' window in Spy++ or when I enumed the child windows under each IEFrame window. The trick is to enum the child windows of the desktop, and then for each window found with a class name of 'Internet Explorer_Hidden' use the sendmessage with the parameter values documented by Alan,

Pseudo Code

Enum the ParentWindows from the Desktop down...

For each occurance of a Window with a class name of 'Internet Explorer_Hidden' use send message to force the redraw without a full refresh....

Call SendMessage(hwnd, &H552, 0&, 0&)

Note: you definition for SendMessage api wParam parameter should use ByVal wParam as long.

Yahoo! now I can streamline my IE apps to make them work even better. This will blow away mozilla themes