?
Solved

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

Posted on 2006-11-05
3
Medium Priority
?
1,932 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 1000 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

Technology Partners: 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

764 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