Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

wait among sendkeys

Posted on 2004-08-04
6
Medium Priority
?
280 Views
Last Modified: 2008-02-26
My code is as follows.. Please insert the wait after the sendkeys I have specified.. I have tried my level best but unable to get the results..

'**************************************

ReturnValue = Shell("myapplication.exe", 1)
AppActivate ReturnValue

Name1 = "Trial" & Number & ".prd"
Name2 = "Trial" & Number & ".csv"

SendKeys "%{s}" & "{right}" & "{right}" & "O", True
SendKeys Name1 & "{TAB}" & "{TAB}" & "{ENTER}", True

SendKeys "%{o}" & "R" & "D" & "{ENTER}", True

?????????????want to wait here for twelve seconds



SendKeys "%{F}~", True
SendKeys Name2 & "{enter}", True

?????????????want to wait here for twelve seconds

If wells <> 0 Then
SendKeys "{left}" & "{left}", True
SendKeys "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}" & "{tab}", True

?????????????want to wait here for twelve seconds


For i = 1 To wells
   
SendKeys "{down}", True
SendKeys "%{F}~", True
SendKeys "w" & i & Name2 & "{enter}", True

?????????????want to wait here for twelve seconds


Next i

End If


SendKeys "%{F}" & "E" & "{enter}", True     ' closing application
SendKeys "%{f}" & "X", True
SendKeys "{ESCAPE}", True


Thank you.

0
Comment
Question by:Aiysha
5 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11720907
Use WinApi Sleep function


Sleep 300 ' wait for 300 milliseconds
0
 

Author Comment

by:Aiysha
ID: 11721211
No, it didnt work... I guess there is no practical way of using waitcommand in sendkey mode.. This help me though..

http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Controls/Q_20550601.html?query=sleep%2C+sendkey&clearTAFilter=true

Very dirty way, but it helped.. Sorry jaime_olivares.. but thanx for trying..


Moderator, Please delete this question.

Thank you.
0
 
LVL 22

Expert Comment

by:cookre
ID: 11721304
One presumes you did a Sleep 12000.

Note that Sleep stop the calling process.  It's not just a local idle loop - all message processing is stopped, too.  The linked example probably failed because he was send ing keys to himself and not an independent app.
0
 
LVL 3

Expert Comment

by:bigjim2000
ID: 11808341
Are you using .NET?

If so, then you can use the System.Windows.Forms.SendKeys.SendWait(string) method.  This sends the keys as normal, but also waits for the key messages to get processed before continuing.

-Eric
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12036235
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question