I need to build a fuction that will help me exit in a 'clean' way from my program. I need it to:
*Exit ALL threads, even if it is called from a grandson thread - it should kill his grandpa and all the grandpa's sons..
*close some hardware devices that are opened in some other place in the program.
*Destroy a taskbar icon opened somewhere else in the program
*Close a mutex handle created somewhere else in the program
and so on...
Is there a nice way of doing all these actions (without having handles/pointers to all the objects mentioned above)?