XP Styles in Visual Studio 2003
-
I am working on a DLL which hosts various dialogs and property sheets which is being developed in Visual Studio 2003. I would like to have Windows XP styled controls but not having much luck so far. I have tried using
#define ISOLATION_AWARE_ENABLED 1
along with embedding a manifest and callingInitCommonControls();
in the constructor for the item but at best it does nothing, at worst it crashes. I have been searching for a way to do this and tried various tools which embed the manifest but they do not seem to have an effect. I have seen articles which suggest setting the manifest in the linker options but I cannot see the option so I believe this must be a 2005+ option. Is there a way to do this or is it just not possible in 2003 projects? -
I am working on a DLL which hosts various dialogs and property sheets which is being developed in Visual Studio 2003. I would like to have Windows XP styled controls but not having much luck so far. I have tried using
#define ISOLATION_AWARE_ENABLED 1
along with embedding a manifest and callingInitCommonControls();
in the constructor for the item but at best it does nothing, at worst it crashes. I have been searching for a way to do this and tried various tools which embed the manifest but they do not seem to have an effect. I have seen articles which suggest setting the manifest in the linker options but I cannot see the option so I believe this must be a 2005+ option. Is there a way to do this or is it just not possible in 2003 projects?Have you added the manifest to your application's resource file as follows?
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.manifest"
Please check Using Windows XP Visual Styles[^] In the newer version of visual studio, embedding manifest is as follows by defining it in stdafx.h
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts, An Article - Understanding Statepattern
-
Have you added the manifest to your application's resource file as follows?
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.manifest"
Please check Using Windows XP Visual Styles[^] In the newer version of visual studio, embedding manifest is as follows by defining it in stdafx.h
#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif-Sarath. "Great hopes make everything great possible" - Benjamin Franklin
My blog - Sharing My Thoughts, An Article - Understanding Statepattern
Thanks for the reply, I have tried adding the manifest as specified but it makes no difference. I have also defined
SIDEBYSIDE_COMMONCONTROLS
in my stdafx.h and calledInitCommonControls()
in my constructor all with no success. I read somewhere that I needed to set the resource ID toISOLATIONAWARE_MANIFEST_RESOURCE_ID
but that stops my DLL from registering. The only part of the "Using XP Visual Styles" I am not sure about it whether I am using the correct SDK. I have installed "Microsoft Platform SDK for Windows XP SP2" and specified the include and lib directories in the project. Is that all that is required to use the SDK or are there more steps I need to take?