Another registry question

Hi,

I am trying to get a touchscreen to work and the calibration program that comes with it is just not working properly. Apparently the calibration points are written into the registry in binary form and I can edit them there. To make this a lot easier I am trying to write a program to read the values and change them to new values. But I have never worked with the registry before. I have looked at a lot of examples on the forums but still am unable to read the values.

Hopefully someone can help me. I need to read these values HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\LowerRightX
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\LowerRightY
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\MiddleX
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\MiddleY
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\ScreenLowerRightX
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\ScreenLowerRightY
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\ScreenUpperLeftX
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\ScreenUpperLeftY
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\UpperLeftX
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\UpperLeftY

The values in there are similar to this:- a3 02 00 00 I don't know anything about converting binary so I was hoping to have some code to convert this and show the value in some text boxes. I can then edit the text boxes and write them back to the registry. Any tips on where to start would be greatly appreciated.
[1767 byte] By [Taipan] at [2007-11-19 15:18:06]
# 1 Re: Another registry question
Click Project, References, scroll down until you find:
Windows Script Host Model

Dim reg As New WshShell

'Read a registry value, note that you cannot enumerate all value
'within the key

MsgBox reg.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\LowerRightX")
'etc

With the Windows Script Host Model you could specify the registry key to read / write

Hope this helps!
HanneSThEGreaT at 2007-11-9 20:25:47 >
# 2 Re: Another registry question
Thanks for the help. I have tried that and I get a runtime error 13 Type Mismatch error. Any ideas?
Taipan at 2007-11-9 20:26:58 >
# 3 Re: Another registry question
Thanks for the help. I have tried that and I get a runtime error 13 Type Mismatch error. Any ideas?

Can you perhaps include the code where it gives you the error :thumb:
HanneSThEGreaT at 2007-11-9 20:27:51 >
# 4 Re: Another registry question
For starters I have just did what you said about including the Windows Script Host Model reference and have so far only tried the code you gave me.

Dim reg As New WshShell
MsgBox reg.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\LowerRightX")

In this registry entry there is a binary value but it just comes back as a run time error type mismatch.
Taipan at 2007-11-9 20:28:56 >
# 5 Re: Another registry question
OK!
Try this then:
Dim Regvalue
RegValue = reg.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\etusbf\Parameters0\LowerRightX")

MsgBox CStr(RegValue)
If this doesn't work, you may want to consider the RegOpenKeyEx API
HanneSThEGreaT at 2007-11-9 20:30:00 >
# 6 Re: Another registry question
same error .. not sure why. I will have to keep digging. Thanks anyway.
Taipan at 2007-11-9 20:30:59 >