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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -