중요 태그

2015년 3월 30일 월요일

Visual C++ 윈도우 음소거 소스

HRESULT hr = E_FAIL;
GUID guidContext = GUID_NULL;
IMMDeviceEnumerator *pEnumerator = NULL;
IMMDevice *pDevice = NULL;
IAudioEndpointVolume *pEndptVol = NULL;

::CoInitialize(NULL);

hr = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_INPROC_SERVER, __uuidof(IMMDeviceEnumerator), (void**)&pEnumerator);
hr = pEnumerator->GetDefaultAudioEndpoint(eRender, eConsole, &pDevice);
hr = pDevice->Activate(__uuidof(IAudioEndpointVolume), CLSCTX_ALL, NULL, (void**)&pEndptVol);
hr = pEndptVol->SetMute(TRUE, &guidContext);

::CoUninitialize();

댓글 없음: