Currently, visual styling of the Windows GUI controls created by Dark BASIC applications is only possible on Windows XP by having an external manifest of the same name and path as the exe file.
It has to contain this (amongst other things):
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
On Windows XP, the executable will prefer this manifest over the built in one.
This makes the executable depend on ComCtrl32.dll v6.0 (which adds the visual styles) instead of v5.0 (which makes everything look like Win 98) for Common GUI controls (message box buttons etc).
Since Windows Vista, loading external manifests and/or preferring them over the internal one seems to be bugged or not supported anymore (see
here,
here and the comment
here).
Per-Exe Solution
So to get styled controls working in these versions of windows, we have to change the internal manifest file of our executables. This can be done with a
Resource Hacker. Open a compiled exe, go to the manifest resource and replace everything within the <assembly></assembly> tag with the following:
<dependency><dependentAssembly><assemblyIdentity type="Win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity></dependentAssembly></dependency>
(do not add any spaces, you may not use more bytes than the old manifest). This could also be done in a hex editor like
Hexplorer (search for "asInvoker").
This works.
Permanent Solution
However this process has to be done over and over again after every recompilation. This is no problem if you don't mind testing without a fancy looking GUI. And since you have to ResHack your release version exe anyways (I do) in order to replace the icon (the DBPro compiler kills semi-transparency of the icons...) and to set the version information most people are ok with that.
But, you could also quickly hack the DBPCompiler.exe to include a correct manifest with the executables it creates. For this, open it in a Hex editor (backup first), search for the first occurrence of "asInvoker" (the second occurrence is part of the manifest of this exe) and replace everything after the closing ">" of the opening "<assembly>" tag with the code above. Pad with spaces (" ") to the opening "<" of the "</assembly>" closing tag. VoilĂ - all exes the compiler creates from now on feature styled GUI elements. (This only seems to work for non XP, on XP you have to use the external manifest... maybe XP doesn't see internal manifest files...).
I uploaded my hacked DBPCompiler.exe (U761) so you don't have to do this yourself:
download here.
I hope this helps.
Regards,
- Paul