使用sndPlaySound或PlaySound播放wav文件, 怎么知道文件已经播放完毕? 使用sndPlaySound或PlaySound播放wav文件, 怎么知道文件已经播放完毕? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 回复人: phy(我希望我是高手,却怎么学都是菜鸟。)具体说明一下, 可以么? 为你提供个思路用线程来播放播放完了,也就是线程的terminate 用mciSendString播放可以收到消息:TForm1 = class(TForm)...protected procedure WndProc(var Message: TMessage); override;...end;procedure TForm1.WndProc(var Message: TMessage);begin if Message.Msg = MM_MCINOTIFY then begin ShowMessage('notify over!'); end else inherited WndProc(Message);end;procedure TForm1.Button1Click(Sender: TObject);begin mciSendString('open "c:\notify.wav" alias notifywav',nil,0,0); mciSendString('play notifywav notify',nil,0,Handle); //第4个参数为回调窗口句柄end; to sysu(死树)要是希望播放中途停止, 该怎么办呢? // 中途停止可以用stopprocedure TForm1.Button2Click(Sender: TObject);begin mciSendString('stop notifywav notify',nil,0,Handle);end; 还有很多命令,详细的去查MSDN的mciSendString函数。 数据插入问题 急急急,如何判断 一行中的某个位置,是一个字的上半字符,还是下半字符?sos WebBrowser里的内容怎么保存为mht格式,怎么把网页中的内容(包括图片)保存到数据库中 高难度逻辑分析题之二 求sql一句 如何取得点击窗口的句柄? 高分求助,怎样实现二级COMBOX? 我下了CXgrid控件后,请问怎么安装? 各位delphi程序员工程师兄弟,现在到年底了,大家都来谈谈你们都拿多少钱的年终奖好吗? DELPHI有没有一个取字串的函数,如123456 我想取到第三位到五位,结果是345 关于怎样写出DLL的问题!?高手帮我! 我的程序为什么不能在别的机器上运行?
用线程来播放
播放完了,也就是线程的terminate
...
protected
procedure WndProc(var Message: TMessage); override;
...
end;procedure TForm1.WndProc(var Message: TMessage);
begin
if Message.Msg = MM_MCINOTIFY then
begin
ShowMessage('notify over!');
end
else
inherited WndProc(Message);
end;procedure TForm1.Button1Click(Sender: TObject);
begin
mciSendString('open "c:\notify.wav" alias notifywav',nil,0,0);
mciSendString('play notifywav notify',nil,0,Handle); //第4个参数为回调窗口句柄
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
mciSendString('stop notifywav notify',nil,0,Handle);
end;