Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET webbrowser control automation

I'm trying to automate some stuff on a flash game running in a webbrowser control in my C# program. Using user32's sendmessage dll I've been able to click at coordinates on regular pages such as google but it doesn't work on flash content. Any ways I can do this? Also it cannot be detectable to the flash game. I have a working one in autoit but I'd like to rewrite it in c# and make it work minimized.

like image 508
Jean-Bernard Pellerin Avatar asked Jan 26 '26 22:01

Jean-Bernard Pellerin


1 Answers

Why not just call your Autoit/Autohotkey script from your C# program using the System.Diagnostics.Process class?

ProcessStartInfo psi = new ProcessStartInfo("your_script.ahk");
psi.CreateNoWindow = true;

Process procScript = Process.Start(psi);
procScript.WaitForExit();

Notice the CreateNoWindow=true to ensure it runs hidden, and the WaitForExit(), to make your code wait for the process to return.

AutoIt and AutoHotkey have some very powerful automation commands that have been refined over the years. It's very hard to reproduce similar C#/.NET functionality that is just as reliable, believe me I've tried.

like image 95
Ash Avatar answered Jan 28 '26 13:01

Ash



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!