Quote Originally Posted by Fishcake
Is it possible to detect what theme windows XP is using so that we can render the controls differently depending on the theme in use?
To detect WHICH visual style is in use, if there is one, you can use the following API call and wrapping function:
Code:
[DllImport("uxtheme")]
private static extern int GetCurrentThemeName (
    [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpszThemeFileName,
    int dwMaxNameChars,
    [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpszColorBuff,
    int cchMaxColorChars,
    [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpszSizeBuff,
    int cchMaxSizeChars
);
// --------------------------------------------------------

public static string XPThemeName ()
{
    if (IsXPThemed())
    {
        StringBuilder buffer = new StringBuilder(260);
        GetCurrentThemeName(null, 0, buffer, 260, null, 0);
        return buffer.ToString();
    }
    return "n/a";
}
The default cheesy theme names are "NormalColor" (blue), "Metallic" (silver), and "Homestead" (disgusting olive green).