Article ID: 142819
Article Last Modified on 7/13/2004
Dim progname As String
Private Sub Command1_Click()
'Ensure that progname is set to the titlebar of Visual Basic while
' running.
progname = "Project1 - Microsoft Visual Basic [run]"
clipboard.Clear
clipboard.SetText DosKeys.Text + Chr$(13) ' Append a <CR>.
AppActivate DosTitle.Text
SendKeys "% ep", 1
AppActivate progname
End Sub
If the text that you send is the DIR command or another command that
takes time, the AppActivate call immediately following the SendKeys
call can interrupt the processing. The AppActivate call should be
placed in a timer with the appropriate interval set, and the timer
should be enabled in the command_click procedure. The timer should
be disabled before exiting the timer.
Keywords: kbhowto kbctrl KB142819