Jeg glemte å skrive en del i prosedyren sist.
Du må først tilføye MMSystem under
uses.
Hær er prosedyren:
procedure SetMPVolume(MP : TMediaPlayer; Volume : Integer);
const
MCI_SETAUDIO = $0873;
MCI_DGV_SETAUDIO_VOLUME = $4002;
MCI_DGV_SETAUDIO_ITEM = $00800000;
MCI_DGV_SETAUDIO_VALUE = $01000000;
MCI_DGV_STATUS_VOLUME = $4019;
type
MCI_DGV_SETAUDIO_PARMS = record
dwCallback : DWORD;
dwItem : DWORd;
dwValue : DWORD;
dwOver : DWORD;
lpstrAlgorithm : PChar;
lpstrQuality : PChar;
end;
var
p: MCI_DGV_SETAUDIO_PARMS;
begin
{ Lydstyrke: 0 - 1000 }
p.dwCallback := 0;
p.dwItem := MCI_DGV_SETAUDIO_VOLUME;
p.dwValue := Volume;
p.dwOver := 0;
p.lpstrAlgorithm := nil;
p.lpstrQuality := nil;
mciSendCommand(MP.DeviceID, MCI_SETAUDIO,
MCI_DGV_SETAUDIO_VALUE or MCI_DGV_SETAUDIO_ITEM, Cardinal(@p));
end;
Da er vel alt som det skal håper jeg..
DiZpel