Problems with TFormSize


I use the TFormSize in an self-Created class which is inherited from TForm.
In "Create" I create the TFormSize-Object and set the options for SaveKey and SaveName.
the End I start "LoadFormSettings()". Some of these Forms were used
multiple times, so I use the SetName-Function from TForm itself to redo
everything again
(like "LoadFormSettings") with the right Name.
But after the Create the app runs in some TReader-Funktions from Delhpi within.
There happens something I don't understand exactly (I thing it loads the Options from the dfm).
At this point in an example here in the ini-File the Value for Top was set to 0 and the old value
(for example 50) was vanished. When the SetName redo the work and run "LoadFromSettings"
it loads the 0 for the Top-Value. (The other Values were also destroyed,
but it is easy to imagine with "Top".)
I can't reproduce it in a simple app so I try another one:
I add an property "UseHook" to the TFormSize and add an if-clause in InstallHook and RemoveHook.
This way everything worked fine and since I can use the Destory-Function of my own
TForm-Class the SaveFormSettings were save.

So, my question is: Can you add an "UseHook", for those who don't need the Hook-Function?
Maybe it makes some problem because of other Hooks from other components,
so it could be helpful for others, too.

Thanks for reading so far and greetings from germany,
 Peter Nomden

We could add this as public property but I really don't understand how this could help.
The InstallHook is done from the TFormSize constructor, so even when you set UseHook = false, it would already have done the hooking from the constructor.
Having a sample source project with which we could reproduce this issue would help to really understand it.


ok, the problem with the Create is obvious. You're right.
I comment the "fSizer.UseHoock := True;" out and it worked.
Maybe because of the change in the source it was rebuild and
was corrected by this? I don't know.
Also it was very hard to reproduce, so I'm looking forward
to check where the problem is comming from.
I was sure it must be because of the hook, since the
INI-File was changed while tracing throught the

Ok, forget about it untill I'm able to give more information.

Greetings from here
 Peter Nomden