Question

When I embed the Visual Styles manifest in my program like this:

// Embed visual style XML manifest
#pragma comment(linker,                           \
    "\"/manifestdependency:type='Win32'"          \
    "   name='Microsoft.Windows.Common-Controls'" \
    "   version='6.0.0.0'"                        \
    "   processorArchitecture='*'"                \
    "   publicKeyToken='6595b64144ccf1df'"        \
    "   language='*'\""                           \
)

// Link common controls library
#pragma comment(lib, "ComCtl32.lib")

Does that mean my program will only run on Windows XP? Or if visual styles are not on the computer will they just use the operating systems default style? I ask because I enabled visual styles in my program that I am developing with Visual Studio 2008 and I want to know what is the earliest version of Windows it can be run on. Should I check WINVER to see if they are running a version that supports visual styles? If so, what version number should I check for in the preprocessor. Another thing I would like to know is, without visual styles, what is the lowest version I can run my program on?

Was it helpful?

Solution

Does that mean my program will only run on Windows XP? Or if visual styles are not on the computer will they just use the operating systems default style?

The latter is true and the documentation defines the exact behaviour (emphasis is mine):

If you want your application to use visual styles, you must add an application manifest or compiler directive that indicates that ComCtl32.dll version 6 should be used if it is available.

Another section in the same page describes some things you should watch out for in terms of backwards compatibility: Making Your Application Compatible with Earlier Versions of Windows. On visual styles, it states:

Much of the visual style architecture is designed to make it simple to continue to ship your product on earlier versions of Windows that do not support changing the appearance of controls.

OTHER TIPS

This is not a problem. The manifest simply tells Windows that you want version 6 of the common controls DLL. The one that's stored in the side-by-side cache (c:\windows\winsxs), not the legacy one stored in c:\windows\system32. The side-by-side cache is a DLL Hell counter-measure, it can store different versions of DLLs with the same name.

The manifest has no effect on earlier versions of Windows, those versions didn't know anything about manifests so don't know to look for them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top