Thanks for chiming in KodeZwerg!
The OnClose event does actually get fired (tested based on your suggestion).
When I change the form caption in the OnClose caption, it actually does change the form caption as expected - yet the form doesn't close.
Some random things I tried in the OnClose event, and none of them do anything until the form receives focus again:
- Application.Terminate doesn't do anything,
- set "CloseAction" to "caFree" doesn't seem to so anything either,
- self.SetFocus doesn't do anything,
- self.SetFocusedControl(self) same result
Note:
With each of these tests, having
self.caption:='123'; in the OnClose event worked, and the caption would actually change. The listed tests were done individually with changing the caption before and after the listed things.
Other observations:
- The icon remains visible in the Dock until the form closes.
- Right clicking the icon in the dock, allows me to select Quit, over and over again, until the form is closed.
- Left clicking the icon in the dock, after having done a "Quit", actually does close the form and application.
- Multiple calls changing the caption works,
- Calling "ShowMessage('123')" works, but the dialog remains behind the other active application.