|
-
Feb 26th, 2012, 10:17 PM
#1
Thread Starter
Member
sendkeys
Hi everyone.
I have some questions for you.
I am working on my application which save work from another application using sendkeys:
SendKeys.Send("^(s)")
SendKeys.Send("file")
SendKeys.SendWait("{ENTER}")
And it works fine,but my problem is that I don't know why sometimes name of the saved file is "file" and sometimes "ile" and sometimes "e".
Why??
-
Feb 26th, 2012, 10:24 PM
#2
Re: sendkeys
My guess would be that focus changes while the key strokes are being sent. SendKeys works just like typing at the keyboard. If focus changes to a different window while you're typing then your keystrokes are sent to that new window.
-
Feb 27th, 2012, 02:40 AM
#3
Thread Starter
Member
Re: sendkeys
But I set focus on that application.Probably due to the speed at which the keys are sent. Any other opinion??
-
Feb 27th, 2012, 02:48 AM
#4
Re: sendkeys
Try adding a delay before SendKeys.Send and see if it works all the time. If it does then you know that it's a focus issue. This is what developers do: they test things to see whether they work as expected.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|