Registriert seit: 11. Okt 2010
86 Beiträge
Delphi XE Starter
|
AW: Lautstärkeregelung Windows Vista / 7
28. Jan 2012, 22:13
Delphi-Quellcode:
//Global:
var endpointVolume: IAudioEndpointVolume = nil;
//Init:
var
deviceEnumerator: IMMDeviceEnumerator;
defaultDevice: IMMDevice;
begin
CoCreateInstance(CLASS_IMMDeviceEnumerator, nil, CLSCTX_INPROC_SERVER, IID_IMMDeviceEnumerator, deviceEnumerator);
deviceEnumerator.GetDefaultAudioEndpoint(eRender, eConsole, defaultDevice);
defaultDevice.Activate(IID_IAudioEndpointVolume, CLSCTX_INPROC_SERVER, nil, endpointVolume);
end;
//Auslesen:
function getvolume:Single;
begin
endpointVolume.GetMasterVolumeLevelScaler(result);
end;
function getmute:boolean;
begin
endpointVolume.GetMute(result);
end;
|
|
Zitat
|