windowswinapithemesuxtheme

Why does OpenThemeData(pParent, L"TEXTSTYLE") fail on XP?


I'm using the theme library to draw some text which works absolutely fine on Windows Vista - however, on Windows XP the returned HTHEME is NULL. This is the code I'm using:

HTHEME hTheme = ::OpenThemeData(pParent, L"TEXTSTYLE");

hTheme is valid on Vista, but NULL on Windows XP.
I've read the documentation for OpenThemeData and Parts and States on MSDN, but nothing mentions that TEXTSTYLE isn't supported on XP (even Google doesn't throw up any good suggestions).


Solution

  • The theme Luna (i.e. the Microsoft-made theme distributed with XP) defines only subset of classes and parts of Aero (Windows Vista and 7).

    If you have access to machines with Windows XP and Vista (or 7) you may preview what's defined by Theme Explorer utility: http://sourceforge.net/projects/mctrl/files/theme-explorer/