|
-
Sep 17th, 2001, 09:14 AM
#1
Thread Starter
Junior Member
Edit DWORD value
I am trying to edit a dword value in the registry with the following code :
Dim hkey As Long
Dim c As Long
Dim r As Long
Dim s As String
Dim t As Long
r = RegOpenKeyEx(HKEY_CURRENT_USER, _
"Software\Microsoft\Windows\CurrentVersion\Internet Settings", 0, KEY_READ, hkey)
If r = 0 Then
c = 255
s = String(c, Chr(0))
r = RegQueryValueExString(hkey, "AutoConfigURL", 0, t, s, c)
s = ""
r = RegSetValueExString(hkey, "AutoConfigURL", 0, REG_SZ, s, Len(s) + 1)
End If
r = 0
If r = 0 Then
c = 255
s = String(c, Chr(0))
r = RegQueryValueExString(hkey, "ProxyServer", 0, t, s, c)
s = ""
r = RegSetValueExString(hkey, "Proxyserver", 0, REG_SZ, s, Len(s) + 1)
End If
r = 0
Dim lData As Long
If r = 0 Then
iDword = 0
r = RegSetValueEx(hkey, "ProxyEnable", 0&, REG_DWORD, lData, 0) '(hkey, "ProxyEnable", 0, REG_DWORD, iDword, 0)
End If
r = RegCloseKey(hkey)
I can save the string values but cant save the dword, please help
It was an electrical problem sir, a conrod went through the block, and knocked the distributer off.
-
Sep 17th, 2001, 10:48 AM
#2
Last parameter should be the length of the value, in your case it is long, so it should be 4:
VB Code:
r = RegSetValueEx(hkey, "ProxyEnable", 0&, REG_DWORD, lData, 4)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|