Modifying msstyles to get Classic theme
Mar 12, 2017 6:02:22 GMT -8
Post by anixx on Mar 12, 2017 6:02:22 GMT -8
This is a part of a letter I received from IbmPad (the original ClassicTheme.exe developer). I publish it here with his permission:
I think it would be way better to modify the theme data file
(aerolite.msstyles for instance). This would be cleaner and would let Metro
apps run normally, but require a lot of work…
Last year I began exploring this file, but did not pursue due to lack of time.
It a priori contains among other things all the elements'
dimensions/positions, colors and bitmap data, so it should be pretty
customizable. Unfortunately it seems this file's signature is checked by
Windows, so modifying it implies having to disable the signature check, or to
dynamically overwrite the theme data memory mapping…
The theme data file is a resource-only DLL. If you are a programmer, here are
some details; all of this is not fresh in my mind but here are a few things I
remember (the structures were extracted from the public symbols of
UxTheme.dll, please see the attached file “uxthm.h”):
— The resource VARIANT\NORMAL seems to contain the theme's main data; it is
an array of struct _VSRECORD. Each entry contains information about a specific
class of widget/element and can carry data like dimensions, colors, bitmap
references; please see the attached file “VARIANT_NORMAL.txt” for an
incomplete and inaccurate text dump (I probably still have the source code of
the dump program somewhere if you are interested).
— The resource CMAP\CMAP is a list of null-terminated UTF16 strings. It
contains the mapping between class IDs found in the _VSRECORD structs and
class names.
— The resources of types IMAGE and STREAM contain the bitmap data, which are
referenced by resource ID in the theme's main resource (VARIANT\NORMAL).
The meaning of the fields “iPart” and “iState” of the _VSRECORD structure is
specific to each class; please see the attached file “vsstyle.h” (from the
Windows SDK). For instance the info related to window decorations is of
classes “Window”, “DWMWindow” and “WindowMetrics”; the info related to
checkboxes is of class “Button”, part 3 (BP_CHECKBOX in vsstyle.h), etc.
Sorry if all of this is confused and unorganized; I don't remember everything
and my English is far from being perfect…
I think it would be way better to modify the theme data file
(aerolite.msstyles for instance). This would be cleaner and would let Metro
apps run normally, but require a lot of work…
Last year I began exploring this file, but did not pursue due to lack of time.
It a priori contains among other things all the elements'
dimensions/positions, colors and bitmap data, so it should be pretty
customizable. Unfortunately it seems this file's signature is checked by
Windows, so modifying it implies having to disable the signature check, or to
dynamically overwrite the theme data memory mapping…
The theme data file is a resource-only DLL. If you are a programmer, here are
some details; all of this is not fresh in my mind but here are a few things I
remember (the structures were extracted from the public symbols of
UxTheme.dll, please see the attached file “uxthm.h”):
— The resource VARIANT\NORMAL seems to contain the theme's main data; it is
an array of struct _VSRECORD. Each entry contains information about a specific
class of widget/element and can carry data like dimensions, colors, bitmap
references; please see the attached file “VARIANT_NORMAL.txt” for an
incomplete and inaccurate text dump (I probably still have the source code of
the dump program somewhere if you are interested).
— The resource CMAP\CMAP is a list of null-terminated UTF16 strings. It
contains the mapping between class IDs found in the _VSRECORD structs and
class names.
— The resources of types IMAGE and STREAM contain the bitmap data, which are
referenced by resource ID in the theme's main resource (VARIANT\NORMAL).
The meaning of the fields “iPart” and “iState” of the _VSRECORD structure is
specific to each class; please see the attached file “vsstyle.h” (from the
Windows SDK). For instance the info related to window decorations is of
classes “Window”, “DWMWindow” and “WindowMetrics”; the info related to
checkboxes is of class “Button”, part 3 (BP_CHECKBOX in vsstyle.h), etc.
Sorry if all of this is confused and unorganized; I don't remember everything
and my English is far from being perfect…