No tak przepisałem sobie ten kod ale dostaje błąd podczas linkowania, jakby jakiegoś pliku lib brakowało może wiesz jakiego?
IMMDevice *lpDefDev = NULL;
IMMDeviceEnumerator *lpDevEnum = NULL;
IAudioSessionManager *lpSesMgr = NULL;
IAudioSessionControl *lpSesControl = NULL;
ISimpleAudioVolume *lpAudioVol = NULL;
long hr;
float VolumeLevel = 0.5;
hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_INPROC_SERVER, __uuidof(IMMDeviceEnumerator), (void**)lpDevEnum);
if( SUCCEEDED(hr) && (lpDevEnum != NULL) )
{
hr = lpDevEnum->GetDefaultAudioEndpoint(0,0, &lpDefDev);
if(SUCCEEDED(hr) && (lpDefDev != NULL))
{
//hr = lpDefDev->Activate(IID_IAudioSessionManager, CLSCTX_ALL, NULL, (void**)&lpSesMgr);
hr = lpDefDev->Activate(IID_IAudioSessionManager, CLSCTX_ALL, NULL, (void**)&lpSesMgr);
if(SUCCEEDED(hr) && (lpSesMgr != NULL))
{
hr = lpSesMgr->GetAudioSessionControl(&GUID_NULL, 0, &lpSesControl);
if(SUCCEEDED(hr) && (lpSesControl != NULL))
{
hr = lpSesControl->QueryInterface(IID_ISimpleAudioVolume, (void**)&lpAudioVol);
if(SUCCEEDED(hr) && (lpAudioVol != NULL))
{
ShowMessage("ok");
lpAudioVol->SetMute(true, NULL);
lpAudioVol->Release();
}
lpSesControl->Release();
}
lpSesMgr->Release();
}
lpDefDev->Release();
}
lpDevEnum->Release();
}