Tried to cram as many relevant words in the title for this to come up in Google when people search for it.
Adding visual styles (common control manifest) to a BHO (Browser Helper Object, or in it’s other names Browser-Extension/Add-in/Band-Object) is not trivial. Thankfully enough our good friends at MS didn’t bother to document this, like a gazillion other things…
here goes:
- Copy over a manifest file from some old project or download one from the net, they are all the same, just change the project name inside and then rename your manifest to ‘mydllfilename.dll.manifest’, so if your extension is ‘wagamama.dll’ your manifest is ‘wagamama.manifest.dll’.
- Right-click your resource root in VS, hit ‘Resource includes’, then add this to ‘Compile-time directives’:
ISOLATIONAWARE_MANIFEST_RESOURCE_ID RT_MANIFEST ““ - Go to stdafx.h or somewhere and:
#define ISOLATION_AWARE_ENABLED 1
You’re good to go.
But if I really wanna know what’s going on, what are the catches ?
- you use ISOLATIONAWARE_MANIFEST_RESOURCE_ID instead of CREATEPROCESS_MANIFEST_RESOURCE_ID
- you need to define ISOLATION_AWARE_ENABLED and set it to 1 or something, if you just define it you get a compile error because of how MS write their code, just look at this:
winnt.h (line 9153):
#if (_WIN32_WINNT > 0×0500) || (_WIN32_FUSION >= 0×0100) || ISOLATION_AWARE_ENABLED // winnt_only
doesn’t that compile wonderfully… you guessed right, when MS bothers to talk about this directive they just tell you to define it, they never expected somebody not to define _WIN32_WINNT to something lower than 0×0500 (xp ?)… so they basically wrote code that never evaluates, ain’t that funny….
More (incomplete) info on this can be found:
http://support.microsoft.com/default.aspx?scid=kb;en-us;830033
http://www.ookii.org/showpost.aspx?post=12
Just create “explorer.exe.manifest” file that contains the common manifest form info for explorer.exe in %WinDir% (Windows folder), then you will get most/all of shell extensions/explorer in process (some supported controls of them) have that visual style enabled. It’s for XP only though (Vista / 7 has enabled it by default, regardless of shell extension). You will also get same result by installing Window Blinds. Regards.