' Loop through each auxiliary audio device installed on the system and display its name and version number.
Dim auxinfo As AUXCAPS ' receives info about each device
Dim numdevs As Long ' number of auxiliary audio devices installed
Dim devname As String ' name of device
Dim majver As Integer, minver As Integer ' major and minor version numbers
Dim c As Long ' counter variable
Dim retval As Long ' return value
' Find out how many auxiliary audio devices are installed.
numdevs = auxGetNumDevs()
' Loop through each one, displaying its name and version number.
For c = 0 To numdevs - 1 ' remember that device IDs are zero-based!
' Get the capabilities of this device.
retval = auxGetDevCaps(c, auxinfo, Len(auxinfo))
If retval = 0 Then
Debug.Print "** AUXILIARY AUDIO DEVICE"; c; "**"
' Extract and display the name of the device.
devname = Left(auxinfo.szPname, InStr(auxinfo.szPname, vbNullChar) - 1)
Debug.Print "Name: "; devname
' Extract and display the version number of the device.
majver = (auxinfo.vDriverVersion And &HFF00) / &H100 ' major version
minver = auxinfo.vDriverVersion And &HFF ' minor version
Debug.Print "Version Number:"; majver; "."; minver
Else
Debug.Print "Could not get information about device"; c; "."
End If
Next c