In my game there are variables that go through all rooms, so if the player leaves the "variable x" worth 10, and goes to another room, when he returns there is the "variable x" worth 10, same thing when he close the game by the button (exit) that I created in the main menu.
It turns out that if for some reason he closes the game by the "close button of windows", this variable is not saved.
This is clear because there is no command for it to happen, it happens that I did not find anything related to the "physical button close windows window" in the game maker.
Detail that my game is not full screen, but if there is no way to create an event in the game maker so that the "variable x" is saved before closing, tell me how do I delete the "physical buttons of the windows window ".
I'm sorry for the awful translation, I'm not an English speaker.