Solved

Windows XP Style - Include the Manifest in the Executable

Posted on 2003-11-14
10
1,216 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now