I'm currently trying to work through the Windows GUI API and the more I see... let's come the the point: Basically i'm following this guide by msdn to enable the visual styles from Win7, but InitCommandcontrolsEx returns false: I'm doing the following:
Include the the headers
#include <windows.h>
#include <commctrl.h>
Initialize it with the desired visual styles
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_STANDARD_CLASSES;
if(InitCommonControlsEx(&icex)) {
cout << "Visual styles loaded" << endl;
} else {
cout << "Error while loading visual styles" << endl;
cout << GetLastError() << endl;
}
Create a resource file which will compile the manifest
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "GUI.exe.manifest"
The manifest itself
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="Company.Project.Name"
type="win32"
/>
<description>Some Description.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type='win32'
name='Microsoft.Windows.Common-Controls'
version='6.0.0.0'
processorArchitecture='*'
publicKeyToken='6595b64144ccf1df'
language='*'
/>
</dependentAssembly>
</dependency>
</assembly>
For that, i'm using windres from GNU binutils
windres GUI.rc GUI.res
And finally, i link against it and ComCtl32.dll
g++ "-LC:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\x64" -mwindows -o GUI.exe "src\\main.o" -lmingw32 -lComCtl32 "src\\GUI.res"
But as mentioned in the introduction, InitCommonControlsEx always jumps into the false block, not showing the updated visual styles which proves the false. Any ideas?
System: Win7 64Bit g++ compiling 64Bit IDE Eclipse CDT