i want to set this to read from the "cd Quality" key
anyone help me ?
ive tried changing key2, "Cd Quality", with no luck ! where am i going wrong ?
Private Function GetDefaultWaveFormat(format As WAVEFORMAT) As Boolean
'////////////////////////////////////////////////////////////////////////////////////
' This user-defined function retrieves the default wave format from the registry.
'////////////////////////////////////////////////////////////////////////////////////
Dim rc As Long
Dim key1 As Long
Dim key2 As Long
Dim formatName As String * 50
Dim length As Long
' Initialize return code
GetDefaultWaveFormat = False
rc = RegOpenKeyEx(HKEY_CURRENT_USER, _
"Software\Microsoft\Multimedia\Audio", _
0, _
KEY_READ, _
key1)
If (rc <> 0) Then
Exit Function
End If
length = Len(formatName)
rc = RegQueryValueString(key1, "DefaultFormat", 0, 0, formatName, length)
If (NO_ERROR = rc) Then
rc = RegOpenKeyEx(HKEY_CURRENT_USER, _
"Software\Microsoft\Multimedia\Audio\WaveFormats", _
0, _
KEY_READ, _
key2)
If (NO_ERROR = rc) Then
length = Len(format)
rc = RegQueryValueEx(key2, _
formatName, _
0, _
0, _
format, _
length)
RegCloseKey key2
If (NO_ERROR = rc) Then
GetDefaultWaveFormat = True
End If
End If
End If
RegCloseKey key1
End Function