Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
   Public Function CurrentTheme() As String
       'Function to get the current Windows XP theme.
       'Optional: You can use it to set different colors for each theme.
       Dim key As RegistryKey
       key = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\ThemeManager")
       If key IsNot Nothing Then
           If "1" = (key.GetValue("ThemeActive").ToString) Then
               Dim s As String
               s = (key.GetValue("ColorName")).ToString()
               If s <> Nothing Then
                   If String.Compare(s, "NormalColor", True) = 0 Then CurrentTheme = "XPBlue" : Exit Function
                   If String.Compare(s, "HomeStead", True) = 0 Then CurrentTheme = "XPGreen" : Exit Function
                   If String.Compare(s, "Metallic", True) = 0 Then CurrentTheme = "XPSilver" : Exit Function
               End If
           End If
       End If
       CurrentTheme = "WindowsClassic"
   End Function

Don't ask what your country can do for you, ask what you can do for your country...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...