Honestly, I did not quite understand how your code will help me, but how to get around this problem I found:
var
FOldControl :TWinControl;
procedure TForm1.EnViewMouseEnter(Sender: TObject);
begin
FOldControl := ActiveControl;
if ImageEnView1.CanFocus then ImageEnView1.SetFocus;
end;
procedure TForm1.ImageEnViewMouseLeave(Sender: TObject);
begin
if Assigned(FOldControl) and FOldControl.CanFocus then
FOldControl.SetFocus;
end;
I just thought that "TImageEnView" has a property for such behavior.