Dim Path As String
Dim ReturnLength As Long
Path = String(255, vbNullChar)
ReturnLength = GetWindowsDirectory(Path, Len(Path))
Path = Left(Path, InStr(Path, Chr$(0))-1)
Dim Path As String * 255
Dim ReturnLength As Long
ReturnLength = GetWindowsDirectory(Path, Len(Path))
Visual Basic から呼び出す
[Module1.bas]
Declare Function _
GetLocalMachineKeyValue Lib "C:\TEMP\NETINIT\VBTEST\REGGET.DLL" _
(ByVal KeyString As String, _
ByVal Entry As String, _
ByVal Value As String) As Long
[フォームのボタン]
Private Sub Command1_Click()
Dim strValue As String * 1024
Dim strKey As String
Dim strEntry As String
strValue = ""
strKey = "Software\Microsoft\Windows\CurrentVersion"
strEntry = "ProductName"
Call GetLocalMachineKeyValue(strKey, strEntry, strValue)
MsgBox (strValue)
End Sub