Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Keys - Help

Status
Not open for further replies.

nomaam

Programmer
Dec 29, 2003
39
CA
i am useing VB.Net, and i am trying to send key strokes to the system. this is what i'm useing:

System.Windows.Forms.SendKeys.Send("j")

i have also tried:

System.Windows.Forms.SendKeys.SendWait("j")

the problem i'm having is that some of the keys i want to send dont' actually get sent. instead i get a "beep" sound from the system.

i thought the "beep" sound ment that i am sending too many keys at one time to the system. so i am sending keys one at a time with a delay function between each key. this still does not work. sometimes the keys get sent with no problem, then sometimes only half or a fragment of the keys get sent, or sometimes none at all.

is there a more reliable way to send keys?

thanks.
 
Where exactly are you "sending" these keys? You are aware that there needs to be an application accepting these keys, right?
 
my VB.NET program opens Internet Explorer and fills out a form in a webpage by sending keys to it after the field has been highlighted by the mouse.

the problem is the keys are not being sent all the time. sometimes it sends them, sometimes just some of the keys, and sometimes none of the keys. its never consistent so i don't know what the problem is.
 
Is that the only possible solution of your task. If you like to fill a input text box on a IE form with some data there is much simpler ways.
 
What bobisto said, plus there is the little problem of bringing that field into focus before you send keys to it.
 
Is that the only possible solution of your task. If you like to fill a input text box on a IE form with some data there is much simpler ways."


i am open to any suggestion. please tell me of your ideas.


"What bobisto said, plus there is the little problem of bringing that field into focus before you send keys to it."


currently the field is brought into focus by the mouse clicking on it. this is done through pre-set mouse coordinates.
 
currently the field is brought into focus by the mouse clicking on it. this is done through pre-set mouse coordinates.
I don't get it yet. Let me try to interpret what you're saying. The user clicks on the IE text field, then your application sends keys to that field, right?

How does your application know that the field is in focus?
 
sorry if i am not clear, i will try to explian more fully:

right now, all my program does is play back a set of recorded mouse coordinates, and a series of mouse clicks.

while the mouse movments are being played back, the mouse clicks on certian fields within a webpage. then keys are sent out to fill in that field. this is done sequentually, so the program does not have to identify what field is in focus.

the problem is that the keys are not being sent all the time. the field is in focus, but for some reason not all of the keys are being sent, sometimes none, sometimes a fraction, or sometimes all of them are sent. it is not consistent so i'm not sure what the problem is.

i was wondering if someone knew a better way of sending keys, or if someone knew how to identify each field within the webpage and check that field if all the keys have been sent. i am not sure how to link the web page within IE to my VB.NET program.

thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top