Windows - , . , , WM_CLOSE, CTRL_CLOSE_EVENT. ; , TerminateProcess().
If you want to save where you were, use a memory mapped file and update it for each action. When your process ends, a dirty page in memory is written back to the OS file, possibly at other times. This solution allows the OS to manage disk I / O for you, and it is in a better position for this.
source
share