tform

Why TForm.Handle is a getter instead of a field?

六月ゝ 毕业季﹏ 提交于 2019-12-02 10:00:39
问题 I was debugging a complicated bug recently. It was caused by accessing a non-existing Form.Handle (garbaged pointer). The bug revealed itself in rather unexpected way for me - accessing Forms Handle caused resizes and repaints. I would expect accessing Form.Handle by a garbage pointer would just return some garbage THandle. Expecting that the Handle is created once on form creation and stays the same till the Form is destroyed. The question Why is it so, that TForm.Handle is not a field that

Why TForm.Handle is a getter instead of a field?

别来无恙 提交于 2019-12-02 06:37:28
I was debugging a complicated bug recently. It was caused by accessing a non-existing Form.Handle (garbaged pointer). The bug revealed itself in rather unexpected way for me - accessing Forms Handle caused resizes and repaints. I would expect accessing Form.Handle by a garbage pointer would just return some garbage THandle. Expecting that the Handle is created once on form creation and stays the same till the Form is destroyed. The question Why is it so, that TForm.Handle is not a field that gets initialized on form creation and is accessed via property Handle: Integer read FHandle; , but is a

How do I catch certain events of a form from outside the form?

百般思念 提交于 2019-11-30 20:15:53
I'm working on something which will require monitoring of many forms. From outside the form, and without putting any code inside the form, I need to somehow capture events from these forms, most likely in the form of windows messages. But how would you capture windows messages from outside the class it's related to? My project has an object which wraps each form it is monitoring, and I presume this handling will go in this object. Essentially, when I create a form I want to monitor, I create a corresponding object which in turn gets added to a list of all created forms. Most importantly, when

How do I catch certain events of a form from outside the form?

心不动则不痛 提交于 2019-11-30 17:00:09
问题 I'm working on something which will require monitoring of many forms. From outside the form, and without putting any code inside the form, I need to somehow capture events from these forms, most likely in the form of windows messages. But how would you capture windows messages from outside the class it's related to? My project has an object which wraps each form it is monitoring, and I presume this handling will go in this object. Essentially, when I create a form I want to monitor, I create

Make 2 forms able to overlap each other?

Deadly 提交于 2019-11-29 14:10:19
I would like to have a seperate form that shows "along" with my main form, so it does not overlap the main form. Here's an example: Notice how the main program, overlaps the log? I can't figure out how to do that in Delphi. Thanks! The answers to this question lie in the very useful Window Features MSDN topic. The pertinent information is: An overlapped or pop-up window can be owned by another overlapped or pop-up window. Being owned places several constraints on a window. An owned window is always above its owner in the z-order. The system automatically destroys an owned window when its owner