线程类如下:type
   TThreadProc = Procedure of object;   TDealThread = class(TThread)
      private
         FThreadProc : TThreadProc;
         FBeforeDestory  : TThreadProc;
      protected
         procedure Execute ;Override;
      public
         constructor Create(ThreadProc : TThreadProc);OverLoad;
         destructor Destroy;Override;         property  OnBeforeDestory: TThreadProc read FBeforeDestory write FBeforeDestory;
   end;implementationuses Forms,windows;constructor TDealThread.Create(ThreadProc : TThreadProc);
begin
   FThreadProc:= ThreadProc;
   
   Inherited Create(TRUE);
end;destructor TDealThread.Destroy;
begin
   OnBeforeDestory;
       Application.MessageBox('文件已经关闭!','提示',mb_OK + MB_ICONERROR);
       
   Inherited Destroy;
end;procedure TDealThread.Execute;
begin
   FThreadProc;   Terminate;    
end;