|
-
May 15th, 2002, 02:48 PM
#1
Thread Starter
Member
Registry
I am trying to get to this location in registry and my code is just not getting me there, here's my code? any help would be appricated?
Here is where I am trying to get to:
HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Location Profiles\Services\{1E6CEEA1-FB73-11CF-BD76-00001B27DA23}\Default\Tab1
Here is my code:
Public Function fGetstring1(HKey As Long, strPath As String, strValue As String)
Dim keyhand As Long
Dim datatype As Long
Dim lResult As Long
Dim strBuf As String
Dim lDataBufSize As Long
Dim intZeroPos As Integer
'Open it
r = RegOpenKey(HKey, strPath, keyhand)
'Query the registry
lResult = RegQueryValueEx(keyhand, strValue, 0&, lValueType, ByVal 0&, lDataBufSize)
If lValueType = REG_SZ Then
strBuf = String(lDataBufSize, " ")
lResult = RegQueryValueEx(keyhand, strValue, 0&, 0&, ByVal strBuf, lDataBufSize)
If lResult = ERROR_SUCCESS Then
intZeroPos = InStr(strBuf, Chr$(0))
If intZeroPos > 0 Then
fGetstring = Left$(strBuf, intZeroPos - 1)
Else
fGetstring = strBuf
End If
End If
End If
End Function
Private Sub Form_Load()
Dim Contex As String
Contex = fGetstring1(HKEY_LOCAL_MACHINE, "Novell","Location", "Profiles","Services","{1E6CEEA1-FB73-11CF-BD76-00001B27DA23}","Default","Tab1")
Label10 = Contex
End Sub
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
|