摘要载入中… 请稍等…
内容载入中… 请稍等…
| ◎→ | 本类最新 |
| 利用Mpegplayer控件编写简单的mp 生成一个波文件 如何在全屏幕显示一个AVI文件 实现avi全屏播放 循环播放音乐 用Delphi 5.0编写在线播放器 在delphi中使用flash控件 在Delphi中实现动态字幕 在Delphi下用Direct Sound 实现混 在Delphi里播放Flash |
|
| ◎→ | 相关资源 |
| VB窗体文章 HTML入门教程 JavaScript入门教程 VbScript入门教程 ASP.net入门教程 C语言入门教程 Deiphi实例教程 Deiphi窗体文章 Deiphi数据库编程 Deiphi网络编程 |
|
| ◎→ | 热门资源 |
| 得到已安装的应用程序列表 定制系统菜单 SEO实践增加外链方法 从实作标题栏按钮开始浅谈组件的 从实作标题栏按钮开始浅谈组件的 “Delphi 书评” 为Delphi程序添加自动滚动的工具 实现应用程序的文件拖放功能 从Internet时间服务器获取标准时 创建除三角形外的各种形状窗体 |
|
你厌倦MediaPlayer吗?用了它你的EXE会大7K。
uses
Windows, Classes, Forms, MMSystem, WinProcs;
var
wDeviceID: Word;
PlayWindow: HWnd;
procedure OpenMCI(PWindow: HWnd; FileName, DeviceType: PChar);
var
OpenParms: Tmci_Open_Parms;
Style: LongInt;
begin
PlayWindow := PWindow;
OpenParms.lpstrDeviceType := DeviceType;
OpenParms.lpstrElementName := FileName;
Style := Mci_Open_Type or Mci_Open_Element;
mciSendCommand(0, MCI_OPEN, Style, LongInt(@OpenParms));
wDeviceID := OpenParms.wDeviceID;
end;
procedure PlayMCI;
var
Info: TMci_Play_Parms;
begin
Info.dwCallback := PlayWindow;
mciSendCommand(wDeviceID, MCI_PLAY, Mci_Notify, LongInt(@Info));
end;
procedure MidiPlay(MidiName: PChar);
const
DevType: PChar='Sequencer';
begin
if MidiName = 'StopMidi' then
CloseMCI
else
begin
OpenMci(Application.Handle, MidiName, DevType);
PlayMci;
end;
end;
procedure CloseMCI;
begin
mciSendCommand(wDeviceID, MCI_CLOSE, 0, 0);
wDeviceID := 0;
end;
end.
使用方法:
MidiPlay("Feeling.mid")); // 注意,这里必须是 PChar 或 char*
MidiPlay("StopMidi");
| 链 接 |
| 芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们 |