using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace send { public partial class Form1 : Form { [DllImportAttribute("User32.dll")] private static extern int FindWindow(String ClassName, String WindowName); [DllImportAttribute("User32.dll")] private static extern IntPtr SetForegroundWindow(int hWnd); [DllImport("user32.dll")] static extern bool SetForegroundWindow(IntPtr hWnd); public Form1() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { int hWnd = FindWindow(null, "New Text Document.txt - Notepad"); if (hWnd > 0) { SetForegroundWindow(hWnd); SendKeys.Send("{TAB}"); SendKeys.Send("{TAB}"); SendKeys.Send("TABBBBBBBBBBBBBBB"); } else { MessageBox.Show("Window Not Found!"); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)