jannemanrobinson

Hi there!

I'm trying to create a program that (amoungst many others) can send keystokes and mouseclicks, much like a playback of a recorded macro would do, in c# to a java-applet (game) on a website...

I looked at several threats in this forum, including the one I found best: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=935288&SiteId=1, but I have some specific problems with it, I'll explain below...

When I invoke the sendkeys method, it sends my keys with a timer with a random interval (much like a human would type), but I encountered something weird:

So the form contains one button and one webbrowser object.  However, keys that are send, won't go in the active java applet, unless I personally click on the applet (on the webpage in my webbrowser object)...  The weirdest thing however is that if I just start my internet explorer (like normal humans would acces the game), then invoce the sendkeys method on my application, and manually click on my open browser window again,  the applet receives the keys like it should...

Is there some way to focus on that specific part of my program by code (the .bringtofront(), .select(), or .focus() won't do the trick, or do I need a combination of these and in wich order  :-s) 

Or could someone type out for me, clearly, (yes I know, again but I'm such a noob), how to simulate an automatic mouseclick where I manually click myself atm

I would be really thankfull if someone could answer me my problem, all code given would be greatly appreciated aswell, since I'm fairly new at this...

Thank you guys!!

Jan

 

ps: is there really no way to run my created programs on a computer that hasn't got the .NET framework installed :-) Just to make my threat a little bigger lol :-)



Re: Visual Basic General Sendkeys to the active internet window

ahmedilyas

in regards to the last question, nope there isnt. you MUST have the .NET framework installed. Either install it manually or create a setup and deployment project which will install the .NET Framework automatically :-)