MFC - launch external application after exit

I want to online update my C++ MFC application. I can download update file from http, but the problem is, that I need to overwrite the file currently in use. So, can I launch external application from MFC program (e.g. SFX archive) after program exit?

Upvotes: 1

Views: 78

Answers (1)

AndersK
AndersK

Reputation: 36082

Look at the function atexit()

In the function you provide you could launch the process that downloads the file.

E.g.

void launchDownload(void)
{
  ShellExecute(...);
}

...

atexit(launchDownload);

See also ShellExecute

Upvotes: 2

Related Questions