views:

744

answers:

2

I need to extract some bitmaps from an .msstyles file (the Windows XP visual style files) and I'm not sure where to start. I can't seem to find any documentation on how to do it, and the file format seems to be binary and not easily parsed. I have been able to extract the bitmap by itself using:

IntPtr p = LoadLibrary(UxTheme.ThemeName);
Bitmap bmp = Bitmap.FromResource(p, "BITMAP_NAME");
FreeLibrary(p);

However, I also need the information related to the bitmap, like the margin sizes, spacing and number of "images" per bitmap. Does anyone have any experience with this or any links to documentation that I can use?

+1  A: 

This site claims the file format is documented though not by Microsoft.
Also found this in the Wine Crossreference.
Hope that helps!

waynecolvin
Thanks - the docs helped a ton. :)
Jon Tackabury
A: 

If you want to get files out of a dll directly (remember, msstyles are dlls with another extension), you could have a look at the Anolis Project.

As for actually parsing that stuff you should look at the various tutorials on creating msstyles for information on how the various text resources in that file work.

This codeproject article seems to have exactly what you want, with a little interop involved. A managed wrapper exists and it seems rather good. The .Net WindowsForms also has the functionality built in, you might want to look at the System.Windows.Forms.VisualStyles namespace if you want simplified read only access.

Jonathan C Dickinson