C++: How do I check if my window is about to close?
问题 I'm trying to make a Win32/*nix console-based ASCII game. I want to use no libraries whatsoever that aren't standard C++ or on *nix/windows(.h). I want it to be structured like a game loop. Aka: while (!WIN_CLOSE_FUNCTION()) { //Do crap } //Do other shutdown crap return 0; Can anyone point me to what function this would be? If it is platform dependent, give me one example on Windows and *nix. 回答1: Similar question that might help you What happens when you close a c++ console application The