zenesin Posted May 22, 2021 Share Posted May 22, 2021 Hello dear forum members. I am building a program with Visual Studio C #, but I could not build and do a function that I easily made in AutoIT in C # programming language. My autoit function is : Func sendCommandForThis($komut) $title = "Program Title" ControlCommand($title, "", "Edit1", "EditPaste", $komut) Sleep(10) ControlSend($title, "", "Edit1", "{ENTER}{ENTER}") EndFunc My C# function is : IntPtr zero = IntPtr.Zero; for (int i = 0; (i < 60) && (zero == IntPtr.Zero); i++) { Thread.Sleep(150); zero = FindWindow(null, title); } if (zero != IntPtr.Zero) { SetForegroundWindow(zero); Clipboard.Clear(); Clipboard.SetText(command.ToString().Trim()); SendKeys.SendWait("^v{ENTER}{ENTER}"); SendKeys.Flush(); } As I said, the function I did on C # is not healthy enough, I have listed the codes. How can I do the same for C # as Autoit ControlCommand function that sends code to another program in the background? Thanks for everyone. Link to comment Share on other sites More sharing options...
zenesin Posted May 22, 2021 Author Share Posted May 22, 2021 Thank you in advance for the help, I'm waiting for your answers. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 22, 2021 Developers Share Posted May 22, 2021 You clearly didn't read the forum rules I pointed you to: this is the exact same question with some minor changes. Consider this your final warning! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts