Skip to content
Dominic Hayes - Feren OS Dev edited this page Nov 14, 2025 · 10 revisions

Welcome to the Wiki, where I document my various discoveries about the Windows XP msstyles format.

Check the navigation to the right for various parts of the msstyles, but first read the following to get started:

A note on parsing INIs

As stated by Microsoft themselves, the headers and ...= parts of INIs are case insensitive - therefore, this guide will refer to them usually in lowercase.

Getting data from the msstyles

tbd

Scaling method for textures in msstyles?

Nearest neighbour. Everything in Windows XP/Basic is nearest neighbour scaled.

It isn't until Windows Vista's DWM that bicubic starts getting used, but even then it is relegated only to DWM's window decorations (presumably because DirectX uses bicubic instead of nearest neighbour for texture scaling?)

sizemargins

If you're familiar with 9-slicing, this value is for you - Size Margins are the sizes, in pixels, whom to chop the control's background image texture at.

When chopped, the remaining section in the center is stretched to fill the remaining space of the control's actual size, while the left-center and right-center slices will be vertically stretched and the center-top and center-bottom slices will be horizontally stretched respectively.

Usage: LEFT(px) RIGHT(px) TOP(px) BOTTOM(px)

Regulations to keep in mind

  • sizemargins cannot total more than the texture's size - if the sum of top+bottom is greater than the image's height, and/or the sum of left+right is greater than the image's width, the image will not be loaded by Windows XP.
  • sizemargins cannot equal the texture's size - if the sum of top+bottom == the image's height the top and bottom size margins will be treated as 0 0 respectively, same with left+right = the image's width.

What if the size margins are larger than the actual control is?

There is one legal case where the top+bottom is greater than the control's physical height, but not the texture's height, or left+right is greater than the control's physical width.

If this happens, Windows will simply scale down a slice, using nearest neighbour scaling, and lower its margin in a consistent pattern as recorded below with image height and top & bottom size margins:

Top margin is smaller than bottom margin

The margins are 9 (top), 17 (bottom) in this example (therefore, 26px tall before cropping begins):

  • 25px tall: 8, 17 (-1, 0)
  • 24px tall: 7, 17 (-1, 0)
  • 23px tall: 7, 16 (0, -1)
  • 22px tall: 6, 16 (-1, 0)
  • 21px tall: 6, 15 (0, -1)...

tl;dr: Initially take away 1px from top margin, then start looping between taking away 1px from top margin then bottom margin (first taking away 1px from top margin).

Top margin is larger than bottom margin

The margins are 17 (top), 9 (bottom) in this example (26px tall before cropping begins):

  • 25px tall: 17, 8 (0, -1)
  • 24px tall: 16, 8 (-1, 0)
  • 23px tall: 16, 7 (0, -1)
  • 22px tall: 15, 7 (-1, 0)
  • 21px tall: 15, 6 (0, -1)...

tl;dr: Initially take away 1px from bottom margin, then start looping between taking away 1px from top margin then bottom margin (first taking away 1px from bottom margin).

contentmargins

Content Margins are the padding inside of the control - the larger this value is the bigger the space around the control's children.

This value will make the control larger or smaller instead of affecting the sizes of the control's children.

Usage: LEFT(px) RIGHT(px) TOP(px) BOTTOM(px)

Clone this wiki locally