Solved

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

Posted on 2006-11-05
3
1,896 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

726 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