Winforms UI hang after DisplaySettingsChangingevent <p>I am working on an application that generally runs 24x7. It does so well for a period of time but I have noticed that after the DisplaySettingsChanging event fires (via an RDP connection) the application will continue to process in the background but the UI becomes completely unusable. It does not tell you in the task manager that the application is unresponsive like when the UI message pump is blocked. I know there is a bug with the SystemEvents class (still in .NET 4?). I have moved our splash screen into the form load event handler and do not create any controls on another thread other than the main UI thread. I have tried subscribing to the following events in the constructor of my main form (which has a valid SynchronizationContext)</p> <pre><code>SystemEvents.DisplaySettingsChanging SystemEvents.DisplaySettingsChanged SystemEvents.UserPreferencesChanged </code></pre> <p>but per <a href="http://stackoverflow.com/questions/4077822/net-4-0-and-the-dreaded-onuserpreferencechanged-hang">this related solution</a> but it doesn't seem to help.</p> <p>What else am I missing here?</p> <p>EDIT 1: Ok after running spy++ I see there are two threads that own windows other than the main UI thread. However when I examine the threads within my process in visual studio I don't see either one. Does that mean some referenced assembly is the culprit? Probably should be a separate question, but how do I find out?</p> <p><a href="https://i.stack.imgur.com/Czkqt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Czkqt.png" alt="enter image description here"></a></p> <p>EDIT 2: The second window is a button click event that opens an open file dialog box. I checked the apartment state for that thread and it is correct STA. I have not determined how or when that other thread is created. Seems like it must be the offender.</p>