I have a COM object written in C# that is a toolbar for the Windows taskbar (implements IDeskSite). I want to either,
Prevent the taskbar from being loaded if a certain application is running
Allow the toolbar to unload itself in the case of an unhandled exception rather than allowing the exception to cause Explorer to crash
For #1, I know I can use a Mutex to check if the application is running, but I'm not sure how to prevent the COM object from continuing to be loaded by the explorer.exe process or how to notify the process that the object had an error and needs to be unloaded.