帮朋友写个小工具,需要在操作之后播放一段提示音,在提示音放完后设置一些状态,我用Delphi里的TMediaPlayer播放,对应有OnNotify可以收到MediaPlay的消息,代码如下,但是始终执行不到ProcessSomething()这里,
procedure TfrmMain.myMediaPlayerNotify(Sender: TObject);
begin
  if myMediaPlayer.Mode = mpStopped then
  begin
    ProcessSomething();
  end;
  myMediaPlayer.Notify := True;
end;
但是当我加了下面那句MessageBox之后就总能正确得到mpStopped,有谁知道为什么?
procedure TfrmMain.myMediaPlayerNotify(Sender: TObject);
begin
  Application.MessageBox(......)//加了这一句,弹出个消息框,确认后就能跳到if里面去
  if myMediaPlayer.Mode = mpStopped then
  begin
    ProcessSomething();
  end;
  myMediaPlayer.Notify := True;
end;
郁闷,我前面那段可是完全照着Borland的例子写的,奇怪,用Delphi的帮帮忙看看:)