What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Visual Basic .NET: Deleting a Registry Value failed

Visual Basic .NET: Deleting a Registry Value failed
Author: Message:
ryxdp
Senior Member
****


Posts: 804
Reputation: 16
29 / Male / Flag
Joined: Jun 2006
O.P. RE: Visual Basic .NET: Deleting a Registry Value failed
Thanks, it works perfectly now. I did originally have an Else in there, but I don't know why I removed it...

Anyway here is the full working code for anyone else stuck on this (doubtful, but who knows :P)

vbnet code:
    Private Sub TrayIcon_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TrayIcon.DoubleClick
        'If screensaver is active on double click, delete the SCRNSAVE.EXE value and change ScreenSaveActive to 0
        If My.Computer.Registry.GetValue(regkey.ToString, "ScreenSaveActive", "Unknown") = "1" Then
            regkey.DeleteValue("SCRNSAVE.EXE")
            My.Computer.Registry.SetValue("HKEY_Current_User\Control Panel\Desktop\", "ScreenSaveActive", "0")
            TrayIcon.Text = My.Resources.inactive
        Else
            'Otherwise create the SCRNSAVE.EXE value and change ScreenSaveActive to 1
            My.Computer.Registry.SetValue("HKEY_Current_User\Control Panel\Desktop\", "SCRNSAVE.EXE", "C:\Windows\System32\ribbons.scr")
            My.Computer.Registry.SetValue("HKEY_Current_User\Control Panel\Desktop\", "ScreenSaveActive", "1")
            TrayIcon.Text = My.Resources.active
        End If
    End Sub

This post was edited on 12-22-2008 at 02:13 AM by ryxdp.
07-13-2008 05:11 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Visual Basic .NET: Deleting a Registry Value failed - by ryxdp on 07-12-2008 at 08:21 AM
RE: Visual Basic .NET: Deleting a Registry Value failed - by Matti on 07-12-2008 at 10:09 AM
RE: RE: Visual Basic .NET: Deleting a Registry Value failed - by ryxdp on 07-12-2008 at 10:16 AM
RE: Visual Basic .NET: Deleting a Registry Value failed - by CookieRevised on 07-12-2008 at 02:55 PM
RE: Visual Basic .NET: Deleting a Registry Value failed - by ryxdp on 07-13-2008 at 12:26 AM
RE: RE: Visual Basic .NET: Deleting a Registry Value failed - by pollolibredegrasa on 07-13-2008 at 01:48 AM
RE: Visual Basic .NET: Deleting a Registry Value failed - by ryxdp on 07-13-2008 at 05:11 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On