Dialog Boxes

I'm trying to learn some Windows resources and i'm playing with dialog boxes. The problem is I don't know how to make them look like this:

http://img526.imageshack.us/i/capture2d.png/

instead of this:

http://img441.imageshack.us/i/capturep.png/ .

Thanks in advance.
You need the following:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

Either add this to your application's resources or save it as a text file with the same name as your application plus ".Manifest".

For more on resource files
http://www.google.com/search?btnI=1&q=msdn+about+resource+files

Else, if my application's executable were named "spiff.exe" then my resource manifest file should be named "spiff.exe.Manifest" and reside in the same directory as the executable.

Hope this helps.

PS. For those of you paying attention, the processorArchitecture type should not be "x86" if you want your program to run under Win64. (It won't run at all otherwise.)
To be fair, I had read about this on MSDN. The problem is my attempt failed miserably. I hadn't gotten past the conceiving of the manifest. Thanks for giving a concrete example. There is another problem though...it doesn't work.

P.S. I am running Win7 x64.
Nevermind...problem solved. For those of you wondering how to do it, just add this line in your main source file:

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

The pitfall is that you have to use Visual C++ 2005 or later.

P.S. That is just one long line. Remove the line break if it occurs.
> ...it doesn't work.

Really? But the #pragma did?

Please, load up Resource Hacker and navigate to the resource number 24, click to expand the tree to item 1 and cut and paste the XML data that appears in the right pane so the rest of us can see it.

If you don't have ResHacker get it here
http://www.angusj.com/resourcehacker/

I for one would like to know what the differences are.

Thanks.
I've been using the #pragma statement from the get-go and it's never let me down, so I'll see your "curious" and raise you one. -:)

I.e., is there any reason to not use the #pragma as opposed to the XLM coding? Also, when you instructed LolFactor to add it to his resources, do you mean simply paste that code into an RC file, or just have it as a simple text file that is included as a resource file in your project?
Last edited on
@Duoas
Yes, that is another thing I don't get....add the manifest where in my resources. Lamblion has a point.
But you are right, I've seen many applications work with exterior manifests like you suggested. It is not, however, the case with mine.

Edit:
I removed the pragma and tried ResHack and replaced resource 24 with the manifest you provided....although it was already there...word for word. Dunno HOW it was there, but it was. Anyway, it didn't work. Sorry to disappoint, but the pragma is just more practical and easy to use, since it resolves the dependencies automatically.
Last edited on
Topic archived. No new replies allowed.