pythoncwindowswinapiwindows-themes

How to check which XP theme is enabled


I have a wxPython which works perfectly on window xp theme but on switching to 'classic theme' rich text cntrl comes up without border. I can enable border for classic theme but for that

Q1. I need to know if classic theme is enabled.

Q2.I am also not sure how many different theme could be there which may break my app appearance. so what could be the best way to go around it?

Q3. Can I enforce a theme for given application? e.g. from python I can load any windows DLL and call functions, but is there any such way?

Edit: in my case ctypes.windll.UxTheme.IsThemeActive() worked


Solution

  • Classic theming is more of a non theme. You check for classic theming by calling IsAppThemed() in UxTheme.dll

    There should therefore be little reason to worry about different themes.

    Lastly, the only choice applications get is whether to try and support theming or not - by including a manifest specifying that the new common controls are to be used. Apps that don't include the manifest will never be themed. Apps that do, will be themed as per the users preferences.