<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>> Date: Mon, 17 Jun 2013 21:16:59 +0200<br><div>> From: nc-gaertnma@netcologne.de<br>> To: fpc-pascal@lists.freepascal.org<br>> Subject: Re: [fpc-pascal] Application.onChangeComponentCount ?<br>> <br>> On Mon, 17 Jun 2013 20:57:33 +0200<br>> Fred van Stappen <fiens@hotmail.com> wrote:<br>> <br>> > <br>> > <br>> > > ><br>> > > > Hello.<br>> > > ><br>> > > > Is there a plan to add a function like Application.onChangeComponentCount ?<br>> > > ><br>> > > > I want to catch a signal when a new form is created (or deleted).<br>> > > > I know that the best way is to create a parent form and from this use<br>> > > > the form.oncreate event.<br>> > > > But if the form has no parent the only way to know if a new form was<br>> > > > created (or deleted) is to check if Application.ComponentCount was<br>> > > > changed. (with a timer)<br>> <br>> In LCL you can use this:<br>> Screen.AddHandlerFormAdded(@OnFormAdded);<br>> <br>> All forms are added to Screen, including those owned by Application.<br>> <br>> <br>> Mattias<br><br><br>Magnifique, many thanks Mattias. ;-)<br><br>Humm, no idea how to do for console application ( like application using fpGUI ?).<br></div>                                         </div></body>
</html>