End Google Ads 201810 - BS.net 01 --> Hi all!

C++, WinAPI

Is there any way to catch when process is being terminated (i.e. terminated by user from Task Manager, or ended in normal case) and do some code there.
In other words I need to execute some code, in any cases when program is ending execution.

Thanks