views:

163

answers:

2

Microsoft Windows lets programmers draw GUI elements using the look and feel of the current theme using functions like DrawThemeBackground and DrawThemeText. The elements are specified by Class, Part, and State, as described at the Parts and States page at MSDN.

Unfortunately, the page is not very informative (at all!). So the question is: is there somewhere a reference of all these parts and states, preferably with images of the elements (in the default Windows Vista/7 theme)?

+11  A: 

I have created a small Windows application, programmed with the table at Parts and States. This application lets the programmer browse and explore all parts and states, using the current OS theme.

Parts and States Explorer
(High-Res)

It can be downloaded at

The (Delphi, Win32 API) source, which is too long to be posted here (due to hundreds of constants) is found at

Andreas Rejbrand
Nice work! Compilable project, please?
TOndrej
@TOndrej: Now the *.zip file contains everything you need to compile it right away (I hope).
Andreas Rejbrand
Wonderful! Thank you very much! Compiles fine now, needs only a few small changes for D2007.
TOndrej
+4  A: 

You're looking for this.

Screenshot

SLaks
Also a nice application. Might not be updated for Windows 7 addition, though.
Andreas Rejbrand
But this is not in the language of the Windows API (http://msdn.microsoft.com/en-us/library/bb773210(VS.85).aspx), but in the language of .NET, right?
Andreas Rejbrand
@Andreas: It's written in .Net, but the underlying elements are identical. I don't know about Windows 7.
SLaks
But it is good to have one Win API and one .NET answer. It might not be obvious which Win API constant corresponds to which .NET identifier, and vice versa.
Andreas Rejbrand
Windows Forms' VisualStyles namespace is falling behind pretty badly. It doesn't cover Vista additions either. Same kind of problem as Environment.GetFolderPath(). Making this OS independent is just not that easy.
Hans Passant