Dialog Boxes

Aug 7, 2009 at 10:37pm
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.
Aug 7, 2009 at 10:50pm
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.)
Aug 7, 2009 at 10:59pm
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.
Aug 7, 2009 at 11:06pm
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.
Aug 7, 2009 at 11:19pm
> ...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.
Aug 7, 2009 at 11:42pm
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 Aug 7, 2009 at 11:43pm
Aug 8, 2009 at 8:16am
@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 Aug 8, 2009 at 8:25am
Topic archived. No new replies allowed.