Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / BlueGUI (and any other ComCtrl providers): How to make Visual Styles work outside of XP

Author
Message
Master Xilo
13
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 30th Jul 2011 04:45 Edited at: 12th Sep 2011 22:10
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):


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:

(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

sladeiw
10
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 2nd Aug 2011 21:58 Edited at: 2nd Aug 2011 22:16
You sir are a genius!

I knew there had to be a better way than all the messing around with skinning etc.

Tested it with Win7 Ultimate (edit: and BlueGUI) and hey presto, instantly nicer looking apps!
Master Xilo
13
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 6th Aug 2011 01:07
Hockeykid
DBPro Tool Maker
12
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 11th Sep 2011 23:05
Is this compiler based off the U77 beta build ?

Master Xilo
13
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 12th Sep 2011 22:09
No, the uploaded version is U761, forgot to mention. But the hack is really easy to apply.

Hockeykid
DBPro Tool Maker
12
Years of Service
User Offline
Joined: 26th Sep 2007
Location:
Posted: 14th Sep 2011 07:49 Edited at: 14th Sep 2011 09:05
Quote: "No, the uploaded version is U761, forgot to mention. But the hack is really easy to apply."


I couldn't get Hexplorer to install. When I attempted to install it the only thing it produced was a shortcut that led to nothing.

Mind applying this to the latest update?

Edit: I was able to find an older version of Hexplorer that installed fine, I tried to do what you said, but failed. I can barley even read the text :S

sladeiw
10
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 14th Sep 2011 11:27
Maybe you could code a small app to backup the original compiler.exe and patch a new one? (Or patch executables easily)
Sph!nx
10
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 23rd Oct 2011 17:28
My previous coding machine just died on me and now I need to compile it on windows 7. The main menu does not work so I tried this solution and the hacked compiler. Both did not work. Any suggestions?

Regards Sph!nx
http://www.mental-image.net

Login to post a reply

Server time is: 2019-10-16 22:51:14
Your offset time is: 2019-10-16 22:51:14