In the Sound Control Panel in Windows, and in the Volume Mixer, all audio devices have a specific icon set.
Is it possible to get which icon is set for a device through the Windows API?
In the Sound Control Panel in Windows, and in the Volume Mixer, all audio devices have a specific icon set.
Is it possible to get which icon is set for a device through the Windows API?
As suggested by Simon Mourier in the comments above, there is a PKEY that can access that data.
You can follow along with most of this sample and just replace PKEY_Device_FriendlyName
with PKEY_DeviceClass_IconPath
.
In short, it's something like this:
// [...]
IMMDevice *pDevice; // the device you want to look up
HRESULT hr = S_OK;
IPropertyStore *pProps = NULL;
PROPVARIANT varName;
hr = pDevice->OpenPropertyStore(STGM_READ, &pProps);
EXIT_ON_ERROR(hr);
PropVariantInit(&varName);
hr = pProps->GetValue(PKEY_DeviceClass_IconPath, &varName);
EXIT_ON_ERROR(hr);
// [...]