03myersd
Oct 18th, 2007, 01:12 PM
I have seen a lot of threads about asking how to give an app an XP theme. There have been almost as many asking how to embed the manifest file so that they don't have to send two files. There is even a similar one here in the code bank. But this one does not require you to install any other programs. After some research I have found that this is the best way:
Step 1: Paste this into a new text file called Exename.exe.manifest, where Exename is the name of your executable. I find that you are best leaving it as project1.exe then rename once you have finished all of these steps.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name=" "
type="win32"
/>
<description></description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
Step 2: Paste this into your source code:
Private Declare Function InitCommonControls Lib "comctl32.dll" () As Long
Private Sub Form_Initialize()
InitCommonControls
End Sub
Step 3: Paste this into another text file and rename as exename.rc:
#define RT_MANIFEST 24
#define APP_MANIFEST 1
APP_MANIFEST RT_MANIFEST ExeName.exe.manifest
Step 4: Open a new command line session. Then move to the folder where your project and the above files are located. Use this command:
rc.exe /r ExeName.rc
Step 5: Add this newly created Resource file to your project by going to Project and then Add new resource file.
Step 6: Compile.
I have noticed that sometimes this doesn't work instantly. The best thing to do is just delete everything you created in these steps and start again. The other main problem is accidentally not renaming files.
I have also heard that your manifest file should be a multiple of 4 bytes. I don't think that this has ever been an issue for me.
Hope this is useful to everyone out there!!!
Step 1: Paste this into a new text file called Exename.exe.manifest, where Exename is the name of your executable. I find that you are best leaving it as project1.exe then rename once you have finished all of these steps.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name=" "
type="win32"
/>
<description></description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
Step 2: Paste this into your source code:
Private Declare Function InitCommonControls Lib "comctl32.dll" () As Long
Private Sub Form_Initialize()
InitCommonControls
End Sub
Step 3: Paste this into another text file and rename as exename.rc:
#define RT_MANIFEST 24
#define APP_MANIFEST 1
APP_MANIFEST RT_MANIFEST ExeName.exe.manifest
Step 4: Open a new command line session. Then move to the folder where your project and the above files are located. Use this command:
rc.exe /r ExeName.rc
Step 5: Add this newly created Resource file to your project by going to Project and then Add new resource file.
Step 6: Compile.
I have noticed that sometimes this doesn't work instantly. The best thing to do is just delete everything you created in these steps and start again. The other main problem is accidentally not renaming files.
I have also heard that your manifest file should be a multiple of 4 bytes. I don't think that this has ever been an issue for me.
Hope this is useful to everyone out there!!!