How to listen for application close (X) event on PC #2285
-
i need to free my data before closing my app before the app is closed by (X), and is it possible to block the close event, I want to show a message "do you want to close the app?" before the app is closed on PC |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Have you tried using the |
Beta Was this translation helpful? Give feedback.
-
So, is it possible to block the application close event? |
Beta Was this translation helpful? Give feedback.
If you search the code for the event, you'll see that it is sent out from here:
It passes a pointer to a
bool
, which is used to control if it should proceed with the closure of the window. So, if you set it tofalse
, it should stop the window from closing. For example: