--- JvPrvwDocOld.pas	Thu Mar  1 15:09:06 2012
+++ JvPrvwDoc.pas	Thu Mar  1 15:15:28 2012
@@ -63,7 +63,7 @@
   JclUnitVersioning,
   {$ENDIF UNITVERSIONING}
   Windows, Messages, SysUtils, Classes, Graphics, Controls, StdCtrls,
-  Forms, Dialogs,
+  Forms, Dialogs, ExtCtrls, // [UH] ExtCtrls added
   JvComponent, JvExControls;
 
 type
@@ -276,6 +276,8 @@
     FOnOptionsChange: TNotifyEvent;
     FOnScrollHint: TJvScrollHintEvent;
     FSelection: TJvPreviewSelection;
+    FHintWindow: THintWindow; // [UH]
+    FHintHideTimer : TTimer;  // [UH]
     procedure DoOptionsChange(Sender: TObject);
     procedure DoDeviceInfoChange(Sender: TObject);
     procedure DoScaleModeChange(Sender: TObject);
@@ -300,6 +302,7 @@
     procedure SetScrollBars(const Value: TScrollStyle);
     procedure SetHideScrollBars(const Value: Boolean);
     function IsPageMode: Boolean;
+    procedure DoHintHideTimer(Sender: TObject); // [UH]
     procedure SetSelection(const Value: TJvPreviewSelection);
   protected
     procedure Change; dynamic;
@@ -451,32 +454,6 @@
   Math,
   JvThemes, JvTypes;
 
-var
-  HintWindow: THintWindow = nil;
-
-function GetHintWindow: THintWindow;
-begin
-  if HintWindow = nil then
-  begin
-    HintWindow := HintWindowClass.Create(Application);
-    HintWindow.Visible := False;
-  end;
-  Result := HintWindow;
-end;
-
-type
-  TDeactiveHintThread = class(TJvCustomThread)
-  private
-    FHintWindow: THintWindow;
-    FDelay: Integer;
-  protected
-    procedure Execute; override;
-  public
-    constructor Create(Delay: Integer; HintWindow: THintWindow);
-  end;
-
-  // returns True if Inner is completely within Outer
-
 function RectInRect(Inner, Outer: TRect): Boolean;
 
   function InRange(const AValue, AMin, AMax: Integer): Boolean;
@@ -925,6 +902,10 @@
   FScrollBars := ssBoth;
   FHideScrollBars := False;
   TabStop := True;
+  FHintWindow := Forms.HintWindowClass.Create(nil); // [UH]
+  FHintHideTimer := TTimer.Create(nil);  // [UH]
+  FHintHideTimer.Enabled := False;
+  FHintHideTimer.OnTimer := DoHintHideTimer;
 end;
 
 destructor TJvCustomPreviewControl.Destroy;
@@ -935,6 +916,8 @@
   FOptions.Free;
   FPages.Free;
   FBuffer.Free;
+  FHintHideTimer.Free;  // [UH]
+  FHintWindow.Free;     // [UH]
   inherited Destroy;
 end;
 
@@ -1372,8 +1355,7 @@
       end;
     SB_ENDSCROLL:
       begin
-        TDeactiveHintThread.Create(500, HintWindow);
-        HintWindow := nil;
+        // [UH] TDeactiveHintThread removed
         Exit;
       end;
   end;
@@ -1779,8 +1761,7 @@
     Msg.Result := 0;
     WMVScroll(Msg);
     Refresh;
-    TDeactiveHintThread.Create(500, HintWindow);
-    HintWindow := nil;
+    // [UH] TDeactiveHintThread removed
     Result := True;
   end;
 end;
@@ -1853,7 +1834,7 @@
     FOnScrollHint(Self, NewPos, S);
     if S <> '' then
     begin
-      HW := GetHintWindow;
+      HW := FHintWindow;  // [UH]
       if not HW.Visible then
       begin
         HW.Color := Application.HintColor;
@@ -1869,6 +1850,10 @@
       HW.ActivateHint(R, S);
       HW.Invalidate;
       HW.Update;
+      // [UH] start hide timer
+      FHintHideTimer.Enabled := False;
+      FHintHideTimer.Interval := Application.HintHidePause;
+      FHintHideTimer.Enabled := True;
     end;
   end;
 end;
@@ -1925,29 +1910,10 @@
   end;
 end;
 
-//=== { TDeactiveHintThread } ================================================
-
-constructor TDeactiveHintThread.Create(Delay: Integer; HintWindow: THintWindow);
-begin
-  inherited Create(False);
-  FreeOnTerminate := True;
-  FHintWindow := HintWindow;
-  FDelay := Delay;
-  if FDelay = 0 then
-    FDelay := Application.HintHidePause;
-end;
-
-procedure TDeactiveHintThread.Execute;
+// [UH] TDeactiveHintThread replaced
+procedure TJvCustomPreviewControl.DoHintHideTimer(Sender: TObject);
 begin
-  NameThread(ThreadName);
-  Sleep(FDelay);
-  if FHintWindow <> nil then
-  begin
-    FHintWindow.Visible := False;
-    FHintWindow.ActivateHint(Rect(0, 0, 0, 0), '');
-    FHintWindow := nil;
-  end;
-  Terminate;
+  FHintWindow.ReleaseHandle();
 end;
 
 procedure TJvCustomPreviewControl.SetSelection(const Value: TJvPreviewSelection);
