Solved

Windows XP Style - Include the Manifest in the Executable

Posted on 2003-11-14
10
1,228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Where is this file? 3 42
c# deserialize JSON from web service using JsonConvert 9 55
How does this modal work? 3 33
C# Web service insert into Oracle table 8 36
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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

737 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