I have a Winforms application, that is deployed on many client sites, and runs with no problems.

I have one site (actually a second has just reported it), where the application will just freeze for no reason.

Event single stack trace we get via a mini dump shows the freeze in the OnUserChanged event...

[![enter image description here](https://i.stack.imgur.com/9yd2b.png)](https://i.stack.imgur.com/9yd2b.png)

The ViewManager.RunApplication is where I call `Application.Run(m_mainFrame.Form);` where m\_mainForm is my main application Form.

I have found many many posts on this and various suggestions, for example custom splash screen - I removed this - no difference, subscribe to the Microsoft.Win32.SystemEvents\* events near app startup as shown below

```
    [STAThread]
    static void Main(string[] args)
    {      
      AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

      Thread.CurrentThread.Name = "My App";

      // Empty handler to try and stop freeze
      Microsoft.Win32.SystemEvents.DisplaySettingsChanged += SystemEvents_DisplaySettingsChanged;
      Microsoft.Win32.SystemEvents.DisplaySettingsChanging += SystemEvents_DisplaySettingsChanging;
      Microsoft.Win32.SystemEvents.UserPreferenceChanged += SystemEvents_UserPreferenceChanged;

      // Must be called before first window creation:
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);

```

I tried to follow [this post](https://blogs.msdn.microsoft.com/dsui_team/2012/10/31/debugging-windows-forms-application-hangs-during-systemevents-userpreferencechanged/) on one of the memory dumps I have been given, but could not get past the second step with windbg

I gave up on this, and next followed what was suggested [here](http://support.microsoft.com/kb/943139/EN-US)

I was given access to a problem client machine, and when it froze, used spy++ to get the following results...

[![enter image description here](https://i.stack.imgur.com/LbpfC.png)](https://i.stack.imgur.com/LbpfC.png) 

As suggested in the post, I expanded the threads and looked for a second thread

I can see two threads with windows in there. Looking into a memory dump I did at the same time, so I could match up the thread Ids), both these threads were just unnamed worker threads (I could not see the main UI thread there wit a window)

The one with **TabletPenServiceHelperClass** looks unusual, and I cannot find much information on it.

Does any one have any suggestions on where to go from here, or what the **TabletPenServiceHelperClass** is, and could this have anything to do with these freezing? This is such a frustrating problem.

Thanks in advance for any information

**[UPDATE1]**

It looks like the thread IDs in Spyxx and Visual Studio (debugging) don't match up at all. I ran my app on my local machine (so I could see what Windows I have inb spyxx), and I can identify my main UI thread in both places, and they have completely different ids...

[![enter image description here](https://i.stack.imgur.com/8RO7Q.png)](https://i.stack.imgur.com/8RO7Q.png)

At any rate, I can see in spy++, I have my main app UI thread with a window, and two extra windows under one other thread...

[![enter image description here](https://i.stack.imgur.com/bPFYi.png)](https://i.stack.imgur.com/bPFYi.png)

I am not sure what this one is either. When I go into the properties (via spy++) I can see one of these windows has the caption `.NET-BroadcastEventWindow.4.0.0.0.3f2ddb3.0`, the other just says `Default IME`.

Does anyone know what these are (Googling does not bring up much.. yet)

At any rate, I don't have the TabletPenServiceHelperClass as the troublesome instance has.