It still thinks the value doesn't exist. I must have missed something in the code you gave me, Cookie.
Here is the full Sub:
vbnet code:
Private Sub NotifyIcon1_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("HKEY_Current_User\Control Panel\Desktop\", "ScreenSaveActive", "Unknown") = "1" Then
My.Computer.Registry.CurrentUser.OpenSubKey("HKEY_CURRENT_USER\Control Panel\Desktop", True)
My.Computer.Registry.CurrentUser.DeleteValue("testingval")
My.Computer.Registry.CurrentUser.Close()
My.Computer.Registry.SetValue("HKEY_Current_User\Control Panel\Desktop\", "ScreenSaveActive", "0")
End If
If My.Computer.Registry.GetValue("HKEY_Current_User\Control Panel\Desktop\", "ScreenSaveActive", "Unknown") = "0" Then
'Otherwise create the SCRNSAVE.EXE value, using the data from conf.ini and change ScreenSaveActive to 1
My.Computer.Registry.SetValue("HKEY_Current_User\Control Panel\Desktop\", "testingkey", "C:\Windows\System32\ribbons.scr")
My.Computer.Registry.SetValue("HKEY_Current_User\Control Panel\Desktop\", "ScreenSaveActive", "1")
End If
End Sub