I suppose you're using GM8.1 (Upgrade when possible), you should go to the Global Game Settings, and disable the option that makes the game close when pressing Escape, when the user press the X button, or Alt+F4, GameMaker recognizes as the player pressed Escape Event.
So what you can do, is:
1 - Create a proper way to close your game, with menus.
2 - Check if Alt+F4 is being pressed, then close the game.
3 - Create an "Other>Close Button" event on your controller object (Assuming that you have one), and then, put your game_end() there to close the game.