I\'m trying to create a hook to monitor the current position of the mouse cursor. Nothing important, I just need to count some pixels during interface design and wanted to l
var thread = Process.GetCurrentProcess().Threads.OfType().
SingleOrDefault(x => x.ThreadState == ThreadState.Running);
if (thread != null)
{
// do stuff here
}