Adding the Windows XP visual style to Visual C++ 6.0 projects
Overview of steps to follow:
- Create a .manifest file as a resource
- Add definition for manifests to project.rc
- Include manifest in project
- Change all dialog fonts
In order to achive this, create a file in your application's resource directory, with a name of the name of your main executable with .manifest appended. The file contents look like:
|<?xml version="1.0" encoding="UTF-8" standalone="yes"?>|
<description>Styles - demonstrate XP styles</description>
You will of course want to alter the elements in Bold type to be something appropriate to your project.
Next, edit your project's resource.h file and the main resource file - in our example this will be called styles.rc. I find this simpler to do with Developer Studio closed so that it doesn't complain about having files modified underneath it.
Add the line:
|MANIFEST_RESOURCE_ID 24 |
to the styles.rc file - and replace the part in bold again with whatever the file name is for your project.
Then open the resource.h file, and add the line:
|#define MANIFEST_RESOURCE_ID 1|
at the start somewhere.
Finally, re-open Developer Studio, and change the fonts on all your dialog resources to be Tahoma and not MS Sans Serif. This font isn't a truetype one, so when the user selects ClearType, XP is not able to apply that option to MS Sans Serif.
If you've added a recent enough Platform SDK to your Developer Studio install, you may find the resource.h line isn't required.