auxGetDevCaps Function

Declare Function auxGetDevCaps Lib "winmm.dll" Alias "auxGetDevCapsA" (ByVal uDeviceID As Long, lpCaps As AUXCAPS, ByVal cbCaps As Long) As Long

Platforms

Description & Usage

auxGetDevCaps retrieves information about the capabilities of an auxiliary audio device. This function can also retrieve capabilities information about the auxiliary audio mapper, if one exists.

Return Value

If an error occured, the function returns a non-zero error code. If successful, the function returns 0.

Visual Basic-Specific Issues

None.

Parameters

uDeviceID
The device ID of the auxiliary audio device. Valid IDs range from 0 to the total number of auxiliary audio devices minus one. This could also be the following flag:
AUX_MAPPER
Retrieve information about the capabilities of the auxiliary audio mapper.
lpCaps
Receives information about the device's capabilities.
cbCaps
The size in bytes of the structure passed as lpCaps.

Constant Definitions

Const AUX_MAPPER = -1

Example

' This code is licensed according to the terms and conditions listed here.

' 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

Category

Audio

Go back to the alphabetical Function listing.
Go back to the Reference section index.


Last Modified: September 6, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/a/auxgetdevcaps.html