The easiest way to be safe here is to keep a list of the processes that existed when your application started, and exclude those from them. However, depending on when your application starts (for example, if it is not part of the system startup), this may allow some applications to slip through cracks. On the other hand, this will allow user-mode hooks for devices (such as mice and keyboard handlers) to continue working, which means that the system can still be used after you kill everything.
You can try WM_CLOSE translation , although I wonβt be surprised if Windows blocks it. This will only affect processes with visible windows, but that may be enough.
The third option is to force ExitWindowsEx from ExitWindowsEx , which will allow the OS to completely shut everything down. Of course, this will also close your own application and force the user to log in again. If you have automatic registration installed, it may be logged in again.
Zooba source share