Código Delphi
[-]...
implementation
{$R *.dfm}
uses MMSystem;
var
Volume: Cardinal;
Details: TMixerControlDetails = (cbStruct: SizeOf(TMixerControlDetails);
cChannels: 2;
cbDetails: SizeOf(Volume);
paDetails: @Volume);
function GetVolume: LongBool;
var Handle: Cardinal;
begin
mixerOpen(@Handle, 0, 0, 0, MIXER_OBJECTF_MIXER);
Result := not LongBool(mixerGetControlDetails(Handle, @Details, MIXER_GETCONTROLDETAILSF_VALUE));
if not (Result or LongBool(Details.dwControlID)) then
begin
Inc(Details.dwControlID);
Result := GetVolume;
end;
mixerClose(Handle);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if GetVolume then
Caption := IntToHex(Volume, 8);
end;
...
end.
0j0: No es la forma "correcta" pero es la mas sencilla.