• Welcome to Jose's Read Only Forum 2023.

Visual styles ? or not?

Started by Zlatko Vid, January 01, 2023, 10:43:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zlatko Vid

In my search for Dialog windows i found this on CodeProject
what is that ...a'?   string as manifest ?

Quote4.1. Enabling Visual Styles

In order to get the common controls 6 visual styles, introduced with Windows XP, you must not only call InitCommonControls (declared in CommCtrl.h), but also embed a manifest XML file into your code. Fortunately, there is a handy trick you can use in the Visual C++ compiler, which I learned from Raymond Chen's blog. Just add this to your code:

#pragma comment(linker, \
  "\"/manifestdependency:type='Win32' "\
  "name='Microsoft.Windows.Common-Controls' "\
  "version='' "\
  "processorArchitecture='*' "\
  "publicKeyToken='6595b64144ccf1df' "\

This will generate and embed the XML manifest file automatically, and you'll never worry about it again.

To call InitCommonControls, you must statically link your program to ComCtl32.lib, and this can be accomplished with a #pragma comment directive as well: