-
I am opening an NTVDM DOS window using VB 6 via shell. Then SendKeys to that window, however the dang keys are getting there too fast sometimes (ie Send Keys "ping etc etc etc" and instead of PING just NG gets there). I have the wait value set to true but it still gets there too fast. Is there anyway to set a pause before the Send Keys? I tried setting AppActivate to True but that errors out, so I'm not sure if that will work...any thoughts?
-
use this little pause sub that I wrote
Code:
'in a module
Public Sub Pause(Duration As Double)
Dim Current As Long
Current = Timer
Do Until Timer - Current >= Duration
DoEvents
Loop
End Sub
'in command button
Pause 2
-
API?
There's a 'sleep' API that might help. Paste this in the Declares section:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Just call:
Sleep 2000
to wait 2 seconds (2000 milliseconds)
-