Advertisement
5_2007-2008 Miscellaneous #191601

WebOne Windows XP Classic Theme On Detection *Minor Fixes*

*MINOR FIX* NOW YOU CAN DETECT Whether Windows XP is running in classic style or without visual styles. The function called can also be used to tell theme color if themes are on. If themes are not on then the function will fail and this code will trap the error and return False. REQUIRES "themeui.dll" Should be on Windows XP versions because this is the theme system. THIS FILE IS NOT THE ONE USED FOR DRAWING THEMES. Please let me know of any problems. I reply to all emails. Also check out my other cool submissions. THIS IS DONE IN ONLY 14 LINES OF REAL CODE NOT COMMENTS

AI

Podsumowanie AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Kod źródłowy
original-source
Dim TheCurrentTheme As New Theme.Theme
Dim Manager As New ThemeManager
Public Function ClassicThemeOn() as Boolean
Dim Testit ' Used to catch if windows is in classic mode
 Set TheCurrentTheme = Manager.SelectedTheme
 
 'Test to see if windows is in classic style
 On Error Resume Next
 Testit = TheCurrentTheme.VisualStyleColor
 If Err.Number = -2147024894 Then
  'Error number is the number caused 
  'when themed.VisualStyleColor Fails
  'when in clasic mode
  ClassicThemeOn = True
 Else
  ClassicThemeOn = False
 End If
 On Error GoTo 0
End Function
Oryginalne komentarze (3)
Odzyskane z Wayback Machine