void Main() { int hwnd = FindWindow(null, "Untitled - Notepad"); SetForegroundWindow(hwnd); SendKeys.SendWait("Notepad'e C#'tan yaziyoruz.{ENTER}Ikinci satir.{ENTER}1{TAB}2{TAB}{ENTER}"); }
[DllImport("user32.dll")]
public static extern int FindWindow( string lpClassName, string lpWindowName ); [DllImport("user32.dll")]
public static extern int SetForegroundWindow( int hWnd );