I am implementing the callback methods from MMNotificationClient
to get notified of audio device changes.
When I change the "spatial sound" settings for the Windows audio driver, then MMNotificationClient::OnPropertyValueChanged()
gets called multiple times.
However, I am unsure how to interpret the PROPERTYKEY
value that is supplied to this method in any meaningful way.
I can simply print the raw key data, e.g.
printf(" -->Changed device property "
"{%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x}#%d\n",
key.fmtid.Data1, key.fmtid.Data2, key.fmtid.Data3,
key.fmtid.Data4[0], key.fmtid.Data4[1],
key.fmtid.Data4[2], key.fmtid.Data4[3],
key.fmtid.Data4[4], key.fmtid.Data4[5],
key.fmtid.Data4[6], key.fmtid.Data4[7],
key.pid);
This gives me output such as:
-->Changed device property {1e94c58f-3e40-4ddb-b10c-a86d8b870a31}#2
But how do I get from this e.g. the name of a property that has changed?
The Microsoft Docs are very unclear on this.