var   
        mciOpenParms:   TMCI_Open_Parms;   
        m_MCIDeviceID:   MCIDEVICEID;  

procedure TForm1.FormCreate(Sender: TObject);
var
mciPlayParms:MCI_PLAY_PARMS;
ret:   integer;
begin
try
  begin
 mciOpenParms.lpstrDeviceType:='';   
      mciOpenParms.lpstrElementName   :=   'xxxx.mp3';   
      mciSendCommand(0,MCI_OPEN,MCI_OPEN_ELEMENT,DWORD(@mciOpenParms));
      m_MCIDeviceID   :=   mciOpenParms.wDeviceID;   
       mciPlayParms.dwCallback   :=   Form1.Handle;   
      mciPlayParms.dwFrom   :=   0;   
      ret   :=   mciSendCommand(m_MCIDeviceID,MCI_PLAY,MCI_FROM   or   MCI_NOTIFY,integer(@mciPlayParms));
      end;
except

end;
end; 

最后修改:2012 年 12 月 25 日
一分也是爱