使用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函数。 ‘Delphi 实现网络驱动器的映射及断开’为何不能实现? filds.DataSet.FieldByName('总金额').DisplayFormat:='#.##元';怎么是错的? 请问如何将当前时间转换成微妙 怎么通过sftp下载文件(想要所少分都行啊) 穷疯了,便宜出卖公司网站空间! Delphy下怎样根据条件返回。 三层结构,SQL2000数据库,在客户端更新数据时狂慢! 有关动态改变Tedit的大小。 如何给各种视频文件(rm/wmv/divx/mpeg2...)在后台进行任意秒的截图 110 关于怎样写出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;