In attach You can found the patch modified.
Now is not lost focus on the window. Could you check it?


Index: customform.inc
===================================================================
--- customform.inc      (revision 13136)
+++ customform.inc      (working copy)
@@ -873,6 +873,34 @@
 var
   FocusHandle : HWND;
   MenuItem : TMenuItem;
+
+  {-----------------------------------------------------------------------
+   Return if the control contain a form
+  -----------------------------------------------------------------------}
+  function IncludeForm(Control : TWinControl) : Boolean;
+  var
+    I       : Integer;
+    Founded : Boolean;
+  begin
+    Founded := False;
+    if Control <> Nil then
+    begin
+      I := 1;
+      while (I <= Control.ControlCount) And (Not Founded) do
+      begin
+        if (Control.Controls[I-1] Is TCustomForm)
+        then
+          Founded := True
+        else
+          If (Control.Controls[I-1] Is TWinControl)
+          then
+            Founded := IncludeForm(Control.Controls[I-1] As TWinControl);
+        Inc(I);
+      end;
+    end;
+    Result := Founded;
+  end;
+
 begin
   with TheMessage do
   case Msg of
@@ -917,7 +945,7 @@
             DebugLn('[TCustomForm.WndProc] ',Name,':',ClassName);
             {$ENDIF}
             LCLIntf.SetFocus(FocusHandle);
-            exit;
+            if not IncludeForm(Self) then exit;
           end;
         end;
       end;
begin:vcard
fn:David Guadagnini
n:Guadagnini;David
org:Biotecnica Instruments S.p.A.;R&D
adr:;;Via Licenza 18;Roma;RM;00133;Italy
email;internet:[EMAIL PROTECTED]
title:Software architet
tel;work:+39064112616
x-mozilla-html:FALSE
version:2.1
end:vcard

Reply via email to