<div class="gmail_quote">On Thu, Jan 21, 2010 at 7:50 AM, Justin Smyth <span dir="ltr"><<a href="mailto:delphian@smythconsulting.net">delphian@smythconsulting.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff">
<div><font face="Arial" size="2">Any one know how to get the Active Handle from the
current Form from TApplication ? Delphi has something for this but i cant see
it. </font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I'm in the progress of getting JVCL working under
FPC / lazarus ( FPC 2.5.1 & Lazarus Win64 V 0.9.29 )</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">I suspect i might need to make a property to read
the TList of FFormList and check on each form to out if its the active form. (
not sure about this part ).</font></div>
</div></blockquote><div><br>Here is a function for you: <br></div></div><br>function FindActiveForm: TCustomForm;<br>var<br> C: TControl;<br>begin<br> C := FindControl(GetFocus);<br> if (C <> nil) and (C.Parent <> nil) then<br>
Result := GetParentForm(C)<br> else<br> Result := nil;<br>end;<br>