VB Code:
  1. Option Explicit
  2. Dim reg As cRegistry
  3.  
  4. Private Sub SaveSettings() 'Writes to Registry
  5.     Set reg = New cRegistry
  6.     'This will create a new value in the Run section
  7.     'so your program will automatically run when Windows starts
  8.        'This will create a new section to store your own keys in
  9.     reg.ClassKey = HKEY_USERS
  10.     reg.SectionKey = ".DEFAULT\Control Panel\Desktop"
  11.     reg.ValueKey = "Wallpaper"
  12.     reg.ValueType = REG_SZ
  13.     reg.Value = CLng(Text2.Text)
  14. End Sub
  15.  
  16. Private Sub GetSettings() 'Reads the Registry
  17.     Set reg = New cRegistry
  18.     reg.ClassKey = HKEY_USERS
  19.     reg.SectionKey = ".DEFAULT\Control Panel\Desktop"
  20.     reg.ValueKey = "Wallpaper"
  21. End Sub
  22.  
  23. Private Sub Form_Load()
  24. Call GetSettings
  25. Text1.Text = reg.Value
  26. End Sub
  27.  
  28. Private Sub Form_Unload(Cancel As Integer)
  29. SaveSettings
  30. End Sub

vbruntime error 13