Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. [DllImport("user32.dll")]
  2. static extern bool SetForegroundWindow(IntPtr hWnd);
  3. static void Main(string[] args)
  4. {
  5. #region Copy From Web
  6. Process pc = Process.Start("iexplore.exe", "http://stackoverflow.com/questions/11512373/findwindow-and-setforegroundwindow-alternatives"); pc.WaitForInputIdle();
  7. // Here i send the keys CTRL + A to select all and CTRL + C to copy on the webbrowser
  8. SendKeys.SendWait("^a^c");
  9. #endregion
  10.  
  11. #region Past In Notpade
  12. Process n = Process.Start("notepad.exe");enter code here
  13. n.WaitForInputIdle();
  14. // Here i send the keys CTRL + V to paste on the notpade
  15. SendKeys.SendWait("^V");
  16. #endregion
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement