CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How do I programmatically change Windows Themes in XP?

    I'd start a new thread, rather than bring up an old one. Not related, really.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  2. #17
    Join Date
    Aug 2010
    Posts
    13

    Re: How do I programmatically change Windows Themes in XP?

    I have one more question. Why do we use .msstyles and not .theme files?

  3. #18
    Join Date
    Jul 2003
    Posts
    135

    Re: How do I programmatically change Windows Themes in XP?

    Quote Originally Posted by farrukh_javeid View Post
    Thanks for the quick response .
    I need to ask if you have used the function Registry.SetValue()? If yes, in what shape the parameters might be.
    Sorry, I am new to visual basic .net
    Here's my WriteRegistryValue function:

    Code:
        ''' <summary>
        ''' Writes a value to the registry.
        ''' </summary>
        ''' <param name="MainKey">Main key to reach as a registry key such as Registry.CurrentUser.</param>
        ''' <param name="Subkey">String of the subkey to read.</param>
        ''' <param name="KeyToWrite">String of the key to write to.</param>
        ''' <param name="KeyValue">Value to write.</param>
        ''' <param name="KeyType">Optional - Type of value being passed as a RegistryValueKind.  If not specified will assume a string value.</param>
        ''' <remarks></remarks>
        Friend Sub WriteRegistryValue(ByVal MainKey As RegistryKey, ByVal SubKey As String, ByVal KeyToWrite As String, ByVal KeyValue As String, Optional ByVal KeyType As RegistryValueKind = RegistryValueKind.String)
            Dim rk As RegistryKey = MainKey.CreateSubKey(SubKey)
            Try
                rk.SetValue(KeyToWrite, KeyValue, KeyType)
                rk.Close()
            Catch ex As Security.SecurityException
                MsgBox("Unable to write to the registry!  You may not have high enough security for registery access." & vbLf & "Key: " & MainKey.ToString & SubKey & vbLf & "Key Name: " & KeyToWrite & vbLf & "Value: " & KeyValue, MsgBoxStyle.OkOnly, "Registry Error")
                Debug.WriteLine(ex.Message)
            Catch ex As Exception
                Debug.WriteLine(ex.Message)
            End Try
        End Sub

  4. #19
    Join Date
    Aug 2010
    Posts
    13

    Re: How do I programmatically change Windows Themes in XP?

    Thank you that was a great help but I want to use .theme files as well in my project. Can you guide me how to accomplish this.
    Thanks in advance.

  5. #20
    Join Date
    Jul 2003
    Posts
    135

    Re: How do I programmatically change Windows Themes in XP?

    Quote Originally Posted by farrukh_javeid View Post
    Thank you that was a great help but I want to use .theme files as well in my project. Can you guide me how to accomplish this.
    Thanks in advance.
    No idea...sorry. As someone else suggested you might want to jsut start a new thread for that.

  6. #21
    Join Date
    Aug 2010
    Posts
    13

    Re: How do I programmatically change Windows Themes in XP?

    Thanks for the help though. Ive already created a thread and just waiting for the help.
    You're posts have been real helpful.
    Regards,

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured