var thread = new Thread(delegate() { //do sth }); thread.IsBackground = true; thread.SetApartmentState(ApartmentState.STA); thread.Start(); ShellExecuteWHook.ThreadACL.SetInclusiveACL(new int[] { thread.ManagedThreadId }); //这里需要非托管的线程ID,请问有办法获取吗? RemoteHooking.WakeUpProcess();
是我的思路错了,之前一直在想从线程外部获取,把那两句移到线程内部,问题就解决了。