Exemple #1
0
 public void CloseThreadInput()
 {
     if (targetProcessId != Process.GetCurrentProcess().Id)
     {
         WindowsAPI.AttachThreadInput(curThreadId, targetProcessId, 0);
         targetProcessId = 0;
     }
 }
Exemple #2
0
        public void OpenThreadInput()
        {
            //IntPtr pWin = WindowsAPI.GetForegroundWindow();
            int id = 0;

            targetProcessId = WindowsAPI.GetWindowThreadProcessId(pWin, ref id);

            if (targetProcessId != Process.GetCurrentProcess().Id)
            {
                WindowsAPI.AttachThreadInput(curThreadId, targetProcessId, 1);
            }
        }