Solved

How do you read a REG_BINARY value from the registry using VB?

Posted on 2006-11-05
3
1,904 Views
Last Modified: 2009-06-06
In all my VBA work, I generally only retrieve string values from the registry or simple REG_DWORD values.  I really don't know how to decode the binary values.   Does it require a Windows API call if I'm not using .NET?  
 
Please note:  This question has already been answered by BlueDevilFan and I'm posting here so that other people can find it and so that I can award him/her the points.  

Please don't bother answering this unless you are BlueDevilFan.  

Thanks!!!!


Tim Jeffryes


0
Comment
Question by:tjeffryes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Expert Comment

by:Ark
ID: 17878906
Private Sub Command1_Click()
   Dim wshShell As Object
   Dim arrData, i, sData
   Set wshShell = CreateObject("WScript.Shell")
   arrData = wshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop\Default TaskBar")
'Now arrData contains a VBArray of integers with members equal to byte sequence in registry key
   For i = 0 To UBound(arrData)
      If sData <> "" Then sData = sData & " "
      sData = sData & Right("0" & Hex(arrData(i)), 2)
   Next i
   Debug.Print sData
   Set wshShell = Nothing
End Sub
0
 
LVL 76

Accepted Solution

by:
David Lee earned 250 total points
ID: 17880244
This was the code I had posted.

Dim WshShell, arrValues, intIndex, varValue
Set WshShell = WScript.CreateObject("WScript.Shell")
arrValues = WshShell.RegRead("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook\0a0d020000000000c000000000000046\001f041a")
Set WshShell = Nothing
For intIndex = LBound(arrValues) To UBound(arrValues) Step 2
     varValue = varValue & Chr(arrValues(intIndex))
Next
arrValues = split(varValue, ";")
For intIndex = LBound(arrValues) To UBound(arrValues)
    Wscript.Echo arrValues(intIndex)
Next
0
 
LVL 1

Author Comment

by:tjeffryes
ID: 17880358
thanks, Ark, for your response.  It looks nearly identical to BlueDevilFan's, but as I noted in my positing, I had already "pre-rewarded" him the points.  

thanks everybody.

Tim Jeffryes
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question