winxptheme.py 742 B

1234567891011121314151617181920212223
  1. """A useful wrapper around the "_winxptheme" module.
  2. Unlike _winxptheme, this module will load on any version of Windows.
  3. If _winxptheme is not available, then this module will have only 2 functions -
  4. IsAppThemed() and IsThemeActive, which will both always return False.
  5. If _winxptheme is available, this module will have all methods in that module,
  6. including real implementations of IsAppThemed() and IsThemeActive().
  7. """
  8. import win32api
  9. try:
  10. win32api.FreeLibrary(win32api.LoadLibrary("Uxtheme.dll"))
  11. # Life is good, everything is available.
  12. from _winxptheme import *
  13. except win32api.error:
  14. # Probably not running XP.
  15. def IsAppThemed():
  16. return False
  17. def IsThemeActive():
  18. return False
  19. del win32api