I'd like to set names to my threads in VS, to ease debugging. This can be set using special exception - How to set name to a Win32 Thread?. However, debugger has to be already attached at the time given exception is thrown.
Is there any possibility to register for an event, when debugger is attached? (I don't want to be checking IsDebuggerPresent every time). I'd throw given 'name my thread' exception in that case.