This technique will not work if the MS DOS application is running in full screeen mode - it must be in a window.
| Activate the DOS application | This is necessary beacuse the SendKeys command sends keystrokes to the active application |
| Wait for the Activate to complete | This was determined by trail and error. If the next command is executed too soon, then only a part of the screen may be captured. Since windows can't tell when activation is complete, a simple for loop wastes some time. |
| Send the Screen Capture key sequence | SendKeys "% ek+{right 81}+{down 28}% ey"
|
| Parse the Clipboard | This gets the data from the clipboard and places each line in a separate array variable so that the program can use it |
Const DOS_ScreenCapture$ = "% ek+{right 81}+{down 28}% ey"
Sub Capture_DOS_Screen ()
Dim i
' MsgBox "Capture_DOS_Screen"
Activate_DOS_App
pause (100) ' Give the application time to execute
SendKeys DOS_ScreenCapture$, True
Parse_Clipboard ' Copies Clipboard to ScreenCapture$()
End Sub
Sub pause (count As Long) ' Just a delay
Dim i As Long, j As Long
j = count * 10#
For i = 1 To j
DoEvents
Next i
End Sub