Compiling a manifest file as a Visual Basic resource file, to give your VB application the Windows XP look.
If you have arrived straight at this page:-
Please view my manifest page first! - It includes download links and a manifest file.
The version of VB5 or VB6 you are using may contain a resource editor. If not, one can be downloaded, either as Microsoft's ResEditI.exe file or the useful Resource Hacker. See my previous page for the download links. If you are using a manifest file to give Visual Basic the Windows XP look, that file can be compiled as a Visual Basic resource, when it can be incorporated into your executable file. With the compiled resource, you will still need to put a common controls declaration at the top of your VB project file.
The visual interface of the Microsoft resource editor usually handles character strings and graphics. To compile a manifest file, we will need to work from the command line or use Resource Hacker. The vbaccelerator examples use the command line, via a batch file.
Here is my own method. First, I compose a manifest file, in this case XPtest.manifest, similar to the Microsoft example.
I then put the following text into a new text file:-
1 24 "XPtest.manifest"
That file is saved and renamed 600.rc - this is my resource definition file, which introduces my manifest file to the resource compiler. The integer 1 tells the resource compiler that the manifest file is the first resource. The integer 24 tells the resource compiler to expect a manifest file. Note the quotation marks round the string.
I usually find it easiest to compile using a batch file, made as follows.
I put the following code into a new text file.
"C:\Program Files\Microsoft Visual Studio\VB98\Wizards\RC.EXE" /r /fo xpVB600.res 600.rc
pause
RC.EXE is my resource compiler file from Microsoft.
/r specifies that the .rc file will only be compiled, not linked to any executable.
/fo allows a new name for the .res file, compared to the .rc file.
My resource file will be named xpVB600.res, my resource definition file is already named 600.rc
I include a pause command so that any error is shown on the screen.
The text file is saved and renamed make.bat - creating an executable batch file.
Double-clicking on the file compiles the resource file - xpVB600.res
Inspecting this file will show it to be the manifest file with a string of symbols at the start.
Incorporate the resource file into your Visual Basic project, to give it the Windows XP look.
|