AppDomain.GetCurrentThreadID vs Thread.ManagedThreadID for Windows API calls?

前端 未结 5 1619
独厮守ぢ
独厮守ぢ 2021-01-11 10:23

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

5条回答
  •  时光说笑
    2021-01-11 10:30

    var thread = Process.GetCurrentProcess().Threads.OfType().
        SingleOrDefault(x => x.ThreadState == ThreadState.Running);
    
    if (thread != null)
    {
        // do stuff here
    }
    

提交回复
热议问题