If this is committed, may I suggest some name changes?

IncludeForm -> ContainsForm (note the s, so no imperative)
Founded -> Found

Ok! In attach


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 ContainsForm(Control : TWinControl) : Boolean;
+  var
+    I     : Integer;
+    Found : Boolean;
+  begin
+    Found := False;
+    if Control <> Nil then
+    begin
+      I := 1;
+      while (I <= Control.ControlCount) And (Not Found) do
+      begin
+        if (Control.Controls[I-1] Is TCustomForm)
+        then
+          Found := True
+        else
+          If (Control.Controls[I-1] Is TWinControl)
+          then
+            Found := ContainsForm(Control.Controls[I-1] As TWinControl);
+        Inc(I);
+      end;
+    end;
+    Result := Found;
+  end;
+
 begin
   with TheMessage do
   case Msg of
@@ -917,7 +945,7 @@
             DebugLn('[TCustomForm.WndProc] ',Name,':',ClassName);
             {$ENDIF}
             LCLIntf.SetFocus(FocusHandle);
-            exit;
+            if not ContainsForm(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