我需要从使用此代码在运行时创建的窗口中获取线程 ID
System.Windows.Window MyWindow = new System.Windows.Window();
MyWindow.Show();
我正在使用窗口处理程序
IntPtr WindowHandle = (new WindowInteropHelper(MyWindow)).Handle;
如何从窗口或其相应的处理程序中获取线程 ID?
最佳答案
根据MSDN
Retrieves the identifier of the thread that created the specified window and, optionally, the identifier of the process that created the window.
关于c# - 从窗口获取线程ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10106966/