Beispiel #1
0
 public static void PasteTextToApp(string strText, string strAppName, string strTitle)
 {
     foreach (Process p in Process.GetProcessesByName(strAppName))
     {
         if (strTitle != null)
         {
             if (p.MainWindowTitle.IndexOf(strTitle) < 0)
             {
                 continue;
             }
         }
         NativeWIN32.SetForegroundWindow(p.MainWindowHandle);
         Thread.Sleep(5000);
         SendMyKeys.SendString(strText);
         return;
     }
 }
Beispiel #2
0
 public static void ClipBoardToApp(string strAppName, string strTitle)
 {
     foreach (Process p in Process.GetProcessesByName(strAppName))
     {
         if (strTitle != null)
         {
             if (p.MainWindowTitle.IndexOf(strTitle) < 0)
             {
                 continue;
             }
         }
         NativeWIN32.SetForegroundWindow(p.MainWindowHandle);
         Thread.Sleep(1000);
         SendMyKeys.SendChar((ushort)Keys.V, false, true);
         return;
     }
 }