const MCI_FMPCOMMAND = $00100000;
const MCI_FMPFLAG = $00200000;
consg MCI_FMPVALUE = $00400000;
type MCI_DGV_FMP_PARMS=record
dwCallback
WORD
dwReturn
WORD
dwCommand
WORD
dwFlag
WORD
dwValue
WORD
rc:RECT
end;
//1.Open device
var
mciOpen : MCI_DGV_OPEN_PARMS;
dwResult : DWORD;
wDeviceID : WORD;// MCI device ID
begin
mciOpen.lpstrDeviceType := 'reelmagic'; // Realmagic驱动已安装
mciOpen.lpstrElementName = 'D:/song/music01.dat';
dwResult = mciSendCommand(0,MCI_OPEN, MCI_OPEN_ELEMENT,
LongInt(@mciOpen)); //打开文件
if dwResult =0 then
wDeviceID := mciOpen.wDeviceID; //save device ID to be used on all other commands
end;
//2.Video out VGA
var
mcifmp:MCI_DGV_FMP_PARMS;
dwFlags
WORD;
begin
mcifmp.dwValue= 2; //chapter
mcifmp.dwCommand=$041b;
dwFlags = MCI_FMPVALUE or MCI_FMPFLAG or MCI_FMPCOMMAND;
mciSendCommand(wDeviceID,MCI_FMP,dwFlags,
longInt(@mcifmp));
end;
// (3) Close device
var
mciClose:MCI_GENERIC_PARMS;
begin
mciSendCommand(wDeviceID,MCI_CLOSE,0,
Longint(@mciClose));
end;
//do
ne.