c++ - CPP, 'X' button listener -


i'm writing cpp program, , want execute function when 'x'(shut down) button pressed.

for example, have infinite loop prints same thing everytime iterates, until 'x' button pressed, , want execute function before process ends.

is there kind of listener matter? or other solution maybe (like delaying process shut down few seconds or something)?

thanks!

if want execute before process ends, can register std::atexit handler. function called before process exits.


Comments

Popular posts from this blog

.net - Bulk insert via Dapper is slower than inserting rows one-by-one -

shared memory - gstreamer shmsrc and shmsink with h264 data -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -