Solved

Windows XP Style - Include the Manifest in the Executable

Posted on 2003-11-14
10
1,223 Views
Last Modified: 2012-06-27
Hi Experts,

I am trying to implement Windows XP styles in my WinForm application. I followed closesly the instructions on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchUsingWindowsXPVisualStylesWithControlsOnWindowsForms.asp as well as some others. However there are still 2 open issues:

1. How can I include the manifest file in the executable AUTOMATICALLY and not manually after the build process?

2. How can I check if the executable contains the manifest itself so that I show Windows XP styles?

The above article in MSDN is somewhat wrong because it shows the way to include the manifest MANUALLY in the executable but in the code it is checked that the manifest exists as a separate file, which is not very clever.

The whole story with the manifest being aside makes setup projects very difficult to handle - now I cannot just say take the result of the original project and create a setup, I need to add also the manifest or to first manually add it in the exe...

Thanks for the help.
TheAvenger
0
Comment
Question by:TheAvenger
10 Comments
 
LVL 3

Expert Comment

by:Sijin
ID: 9753601
If you are using .Net Framework 1.1 you can set the EnableVisualStyles property of the application object to enable winxp styles. But you also will have to make all controls have FlatStyle = System.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsapplicationclassenablevisualstylestopic.asp

0
 
LVL 20

Author Comment

by:TheAvenger
ID: 9754125
The problem how to include the manifest file in the executable automatically is still interesting for me. However your solution Sijin solves my problem at the moment. So I will reward you points through a different question and leave this one open for more posts.

Please post an answer here so that I can accept it:
http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20799006.html
0
 
LVL 12

Expert Comment

by:vascov
ID: 9811268
You can use a post build action and/or a macro or add-in.
In the same article you mentioned initially there's a not to another article, which may be of help:

Creating a Visual Studio .NET Add-In to provide Windows XP Theme Support
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnperfmo/html/xpthemeaddin.asp?frame=true


BTW, even in .NET v1.1, do Application.DoEvents right after EnableVisualStyles. (this will solve some initialization issues that happen in some projects)

HTH
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 20

Author Comment

by:TheAvenger
ID: 9811292
OK, this could be a solution (both actually, the post build action and the macro) but how shall it include the manifest in the exe? Is there a command prompt command that can include it (I can put command prompt commands only in the post build event)?
0
 
LVL 3

Expert Comment

by:WiB
ID: 9811741
0
 
LVL 20

Author Comment

by:TheAvenger
ID: 9811891
WiB: sounds just great but... it's for VC++ 6.0 and does not work for C# :-((
0
 
LVL 18

Expert Comment

by:testn
ID: 9815595
0
 
LVL 20

Author Comment

by:TheAvenger
ID: 9816293
As you have seen above, I have read this link and it really works. But I have to do this MANUALLY every time I compile the executable and what I want is to include it AUTOMATICALLY. Can this be done at all?
0
 
LVL 18

Accepted Solution

by:
testn earned 250 total points
ID: 9829679
Oops.... sorry about that...

try http://www.msjogren.net/dotnet/download.asp?thememe.zip and let me know
0
 
LVL 20

Author Comment

by:TheAvenger
ID: 9830144
OK, this one worked. Thanks!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question