I'm making a game that saves some Ints to a .dat file when the user presses Esc and ends the program. That works fine, but the game is in windowd mode and when the user clicks on the little X instead of pressing Esc, it doesn't run the code the saves before quitting. How can I save my game when you press the little X?
How I am saving the game:
How I am saving the game:
While Not KeyHit(1) Wend SaveData() End