static void SendKey() { var bar = WinApi.FindWindow(null, "Form1Text"); var btnBar = WinApi.FindWindowEx(bar, IntPtr.Zero, null, "button1"); var txtBar = WinApi.FindWindowEx(bar, btnBar, null, null); //WinApi.SendKey(txtBar, KeySnap.VK_CAPITAL); //Thread.Sleep(500); WinApi.SendKey(txtBar, KeySnap.VK_A); Thread.Sleep(1000); WinApi.SendKey(txtBar, KeySnap.VK_B); Thread.Sleep(1000); WinApi.SendKey(txtBar, KeySnap.VK_C); }