In the WndProc() method, you will not see the WM_QUIT WM_QUIT , since WM_QUIT is a signal for message cycles to stop executing and as such are usually not sent to the window procedure.
There is no specific event for what you ask. However, you can open the .dpr project file and put in any code you need after calling Application.Run . The message loop is no longer running, but the Application and MainForm are not yet freed.
Remy Lebeau
source share