Delphi: Detect when a new form has been created

后端 未结 3 1221
暖寄归人
暖寄归人 2021-01-20 09:46

I\'d like to detect when a new form has been created.

Now I use the Screen.ActiveFormChange event and check for new forms in Screen.CustomForms

3条回答
  •  天命终不由人
    2021-01-20 10:24

    Thanks to David I found a solution: The clue is to replace Screen.AddForm method with your own. The way how to do it is described in these SO answers:

    • How I can patch a private method of a delphi class?
    • How to change the implementation (detour) of an externally declared function
    • Patch routine call in delphi

    Thanks again!

提交回复
热议问题