ManifestMaker: Creating your own Manifest


When switching over to .NET, I was annoyed at how difficult it was to use Windows XP themes in my applications, so I created this class to ease my life.

To use it, add ManifestMaker.cs to your project. Then create a text file called Manifest.txt and have it contain the data you want your manifest file to contain. Add this file to your project (right click the project, choose add existing item), and then change it's BuildAction to Embed Resource. 

Then, change your Main function to be something like this:

static void Main()
{
BarryJ.ManifestMaker mm =
new BarryJ.ManifestMaker("EasyManifest");
if ( mm.bRestarting != true )
{
Application.Run(
new Form1());
}
}

How does it work? Well, it checks if a manifest file is present in the working directory, and if there isn't, it will make one containing the data in Manifest.txt and then restart the application.


Similar Articles