小弟在一个工程中有多个窗体,在其中一个设置了mediaplayer 控件,在结束程序时, 我在该窗体中这么写
procedure TForm3.Form3close(Sender: TObject; var Action: TCloseAction);
begin
if mediaplayer1.Mode=mpplaying then mediaplayer1.Stop;
if mediaplayer1.Mode=mpopen then mediaplayer1.Close;
end;然后到主窗体中执行关闭整个的功能,
在主窗体关闭时是
Application.Terminate;
但是 就是关闭不了这个程序。我做断点看程序就是停在了Application.Terminate这,不动了。
如果我把窗体改称procedure TForm3.Form3close(Sender: TObject; var Action: TCloseAction);
begin
if mediaplayer1.Mode=mpplaying then mediaplayer1.Stop;
mediaplayer1.Close;
end; 结果会弹出 no mci device
但是 关闭主窗口时,就没有问题了,这是怎么回事啊
高手给指点一下
procedure TForm3.Form3close(Sender: TObject; var Action: TCloseAction);
begin
if mediaplayer1.Mode=mpplaying then mediaplayer1.Stop;
if mediaplayer1.Mode=mpopen then mediaplayer1.Close;
end;然后到主窗体中执行关闭整个的功能,
在主窗体关闭时是
Application.Terminate;
但是 就是关闭不了这个程序。我做断点看程序就是停在了Application.Terminate这,不动了。
如果我把窗体改称procedure TForm3.Form3close(Sender: TObject; var Action: TCloseAction);
begin
if mediaplayer1.Mode=mpplaying then mediaplayer1.Stop;
mediaplayer1.Close;
end; 结果会弹出 no mci device
但是 关闭主窗口时,就没有问题了,这是怎么回事啊
高手给指点一下
if mpOpen = MediaPlayer1.Mode then
MediaPlayer1.Close;
比如楼上的方法。
但是程序还是从application.termiate 之后就不结束
procedure TForm3.Form3close(Sender: TObject; var Action: TCloseAction);
begin
if mediaplayer1.Mode=mpplaying then mediaplayer1.Stop;
mediaplayer1.Close;
end;
改成
procedure TForm3.Form3close(Sender: TObject; var Action: TCloseAction);
begin
if mediaplayer1.Mode=mpplaying then mediaplayer1.Stop;
if mpOpen = MediaPlayer1.Mode then MediaPlayer1.Close;
mediaplayer1.Close;
end;吗? 这样的结果是 提示no mci device open