How can I make a program detect if the computer is being shut down? That way I can make my editor save it's data before the system closes it.
Thanks, August.
How can I make a program detect if the computer is being shut down? That way I can make my editor save it's data before the system closes it.
Thanks, August.
Since C++ has no concep tof this you are going to have to provide some information in terms of your operating system. In UNIX you get a SIGTERM when yoru application is being shutdown, on windows you get a WM_SOMETHINGOROTHER. Obviously these are quite different. If you are using windows your question is more suited in the Windows forum.
on windows you recieve WM_QUERYENDSESSION then a WM_ENDSESSION.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi