alogrep 0 Posted July 17, 2021 Hello. Delphi Sydney. I have a form,created once at application start. The form contains const UM_ACTIVATED = WM_USER+1; (I also tried WM_APP) .... private procedure UMActivated(var Message: TMessage); message UM_ACTIVATED; ... FormActivate(Sender: Tobject); ... postMessage(Handle, UM_ACTIVATED, 0, 0); procedure UMActivated only sets some variables; When the form is shown modal and then hidden (deactivated?) by Modalresult=MrOk, a subsequent showmessaage() call restarts the FormActivate of the form. If I remove the postmessage(), everything works ok. Any sugestion on how to avoid this? In previous versions (non XE) this did not happen. Thanks in advance Share this post Link to post
alogrep 0 Posted July 17, 2021 I found out why. I had the showmodal of the second form inside Formactivate of the first form. I used a postmessage() in the Formactivate to open the 2nd form and that eliminated the problem. I guess with the XE Delphi if the form activation was not completed, the screen.activeforms list was not restored to the 1st form because it had not been activated completely yet (the postmessage makes the 2nd form opening happen when the 1st form has completed its activation). Share this post Link to post