読み取り例

Dim phkResult As HKEY
Dim hKey As HKEY
Dim lpData As BytePtr
Dim lpcbData As DWord
Dim lpType As Long
lpcbData=100
lpData=calloc(lpcbData)
If RegOpenKeyEx(HKEY_CLASSES_ROOT,".jpg",0,KEY_READ,phkResult)<>ERROR_SUCCESS Then
    MessageBox(NULL,"レジストリキーのオープンに失敗しました。","",MB_OK)
    End
End If
If RegQueryValueEx(phkResult,"",0,NULL,VarPtr(lpData[0]),VarPtr(lpcbData))<>ERROR_SUCCESS Then
    MessageBox(NULL,"レジストリの値の読み取りに失敗しました。","",MB_OK)
    RegCloseKey(phkResult)
    End
End If
MessageBox(NULL,VarPtr(lpData[0]),"",MB_OK)
End