Groups > Borland > Borland Delphi multimedia > TWindowsMediaPlayer slow destroy




TWindowsMediaPlayer slow destroy

TWindowsMediaPlayer slow destroy
Fri, 30 Nov 2007 14:02:36 -000
I'm using D2007 with TWindowsMediaPlayer imported from wmp.dll version 
9.0.0.3354

When I either set the TWindowsMediaPlayer.Parent = Nil or call 
TWindowsMediaPlayer.Free there's a long "hang" approx 10 seconds which
seems 
to be happening as indicated below:

procedure TOleControl.DestroyWindowHandle;
begin
  if FMiscStatus and OLEMISC_INVISIBLEATRUNTIME = 0 then
  begin
    SetWindowLong(WindowHandle, GWL_WNDPROC, Longint(DefWndProc));

--->> This call here

    if FOleObject <> nil then FOleObject.Close(OLECLOSE_NOSAVE);

--- >> now back to full speed.

    WindowHandle := 0;
  end else
    inherited DestroyWindowHandle;
end;

... which is far as I am able to trace it (seems to be inside wmp.dll)

I have tried:
1) Setting TWindowsMediaPlayer.URL:= ''
2) Hiding TWindowsMediaPlayer
3) Hiding the window containing TWindowsMediaPlayer
4) Calling TWindowsMediaPlayer.Close;
5) Calling TWindowsMediaPlayer.controls.stop;
6) Setting TWindowsMediaPlayer.enabled:= False;

but there's always the hang.

Any help gratefulyl received.

-- 
Ed.



Post Reply
about | contact