Vista Look?

BlitzMax Forums/MaxGUI Module/Vista Look?

coffeedotbean(Posted 2007) [#1]
I know adding a manifest file to MaxGUI can give all the buttons etc the XP look, but how can I give the buttons the Vista look (when running on vista ofc)?


SebHoll(Posted 2007) [#2]
In exactly the same way, just add the same manifest file or import a manifest object file. It will give the EXE the theme layout for either OS.


coffeedotbean(Posted 2007) [#3]
hum.. well i tired that but no vista look, buttons were different (similar to classic) from XP and classic buttons so something happened but they were not normal vista buttons.

My vista is 32but Home Premium.

<?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="Application"
type="win32"
/>
<description>Program 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>



SebHoll(Posted 2007) [#4]
Instead of using a separate manifest file, try importing the following .o file into your source: (removed) (just under any framework/module importing) - I managed to get XP and Vista theme buttons this way. And you don't need an additional manifest file for it to work. :-)


coffeedotbean(Posted 2007) [#5]
Thankyou.... that worked =D


SebHoll(Posted 2007) [#6]
No probs - just to clarify, the xpmanifest.o file is just a manifest file that I converted using a MinGW tool into an object file. This means you can get BlitzMax to store the manifest file information inside your EXE. Also, it means that it should still work even if you rename your EXE.


Grisu(Posted 2007) [#7]
Can someone post some Vista shots to show what this file does?


Grisu(Posted 2007) [#8]
I have another problem: I'm already importing an .o file for displaying a window/exe icon. It seems bmx has a problem with importing 2 different .o files the same time. Only one works at a time? Any ideas how to solve this issue?


SebHoll(Posted 2007) [#9]
You'll have to remake the object file with both the manifest and your icon set - I needed to do this for my project which is a bit inconvenient, but once it's set up, it's done.


Grisu(Posted 2007) [#10]
That was my guess. But how do I do that?


Grisu(Posted 2007) [#11]
Anyone? *bump


SebHoll(Posted 2007) [#12]
Lol Grisu, I'm on holiday at the moment and went online to check my e-mail... Anyway, I've only just got your message.

After having done this for my project *ages ago*, I'd have thought I would have kept the original resource file, but I didn't. So I've gone searching for how I did it, and I think I've remembered. Here we go:

Steps To Creating an All-In-One Object Resource:

Including:

> Icons
> XP/Vista Manifest
> EXE Description

1. Copy your icon and manifest file into a new folder using filenames of less than 8 characters (probably not needed but best to be safe). You said that you had some problems with the manifest above, so I've provided the one that I used to compile the object file above (you can change the description in italics to suit your own program):

<?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="Application"
type="win32"
/>
<description>This description is shown when the mouse hovers over the EXE icon etc.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
2. Paste the following text into Windows Notepad (to remove formatting) and save as resource.rc in the same folder used above. Obviously, change the italic string literals to suit your needs.

1 24 "mygame.exe.manifest"
101 ICON "icon.ico"

1 VERSIONINFO 
FILEVERSION 1,0,0,0 
PRODUCTVERSION 1,0,0,0 
FILEOS 0x40004
FILETYPE 0x1
{ 
BLOCK "StringFileInfo" 
{ 
 BLOCK "040904b0" 
 { 
  VALUE "Comments", "This is the product description."
  VALUE "CompanyName", "My New Company" 
  VALUE "FileVersion", "1.0.0.0" 
  VALUE "FileDescription", "This is the file description." 
  VALUE "InternalName", "This is the internal name." 
  VALUE "LegalCopyright", "Any info relating to copyright" 
  VALUE "LegalTrademarks", "Legal stuff" 
  VALUE "OriginalFilename", "MyApp.exe" 
  VALUE "ProductName", "My Application" 
  VALUE "ProductVersion", "1.0.0.0" 
 } 
}
BLOCK "VarFileInfo"
{
  VALUE "Translation", 0x0409, 0
}
}
3. Providing you have MinGW set up and fully working with BlitzMax, open up the command prompt, and type: (Again, you will need to substitute in the actual path you used.)

windres -i "C:\My\Path\resource.rc" -o "C:\My\Path\myobject.o"
4. After executing the above line, a new file called myobject.o will be created which you can then import into your BlitzMax app. You shouldn't need to distribute any icons or manifest files with your EXE ever again!

If you found it works fine, let me know, and I'll add it to the BlitzMax Tutorials section.

Seb


Grisu(Posted 2007) [#13]
Thanks a lot! It seems to work. Can't test it under Vista though...

For Step 3 I needed to write a small app, as the compiler didn't start itself:



Please add this to the code archives!

P.s.: Do you know the language value for "German" or is "English (USA)" the default one for executables made with bmx?


SebHoll(Posted 2007) [#14]
Not sure why it wouldn't start by itself as your app does exactly the same thing, but anyway...

You can specify the language of the EXE in the resource file under the VARFILEINFO and STRINGFILEINFO blocks at the bottom of the code you copied and pasted. German is 0x0407 (as oppose to US English which is 0x0409) so just substitute the values and recompile the object .o file.

NB: The number quoted under STRINGFILEINFO is comprised of the lanuguage id and the character set id, one after the other (scroll down the MSDN page for character set info).

Grisu: If you want me to test it on Vista for you, then just e-mail it to me and I'll let you know.


Grisu(Posted 2007) [#15]
Thanks again!

Well, I don't know how good your German is, cause the app texts are in German. ;)

~5,8 MB Inno Setup installer in the basic version.


SebHoll(Posted 2007) [#16]
Well, I don't know how good your German is, cause the app texts are in German. ;)

~5,8 MB Inno Setup installer in the basic version.

Lol, it's up to you - my German is non-existent (I chose to study French at school instead) but I could probably guess what to do for the installation - the 'Next' button for Inno Setups are likely to be in the same place no matter what language is used. As long as it doesn't format my hard-drive, I don't mind. ;-) I suppose I could use Google Translate if I got really stuck.


Grisu(Posted 2007) [#17]
I hated our teacher for french, so I took latin instead. :)
Bad choice. - Less girls in the class. But that was a long time ago.

Anyway, you've got mail.