Although it is technically not possible for
a Windows program to send keystrokes directly to a DOS application running in a DOS
window, there is a way to cheat and get Windows to do the job for us. An interesting
feature of Windows is that it supports the ability to "Cut and Paste" data
between DOS and Windows programs using the Windows clipboard. In order to get the Wedge to
send data to a DOS application in a DOS window you first have to send the data as
keystrokes to a Windows program and then send additional keystrokes that first
"cut" the data from the Windows application, switch the focus to the DOS window
and finally "paste" the data into the DOS window.
To try this technique, configure the Wedge in
"Send Keystrokes" mode specifying the NotePad program as the target for all
keystrokes from the Wedge. Next, configure the Wedge to work with your serial device and
then add the following characters to the end of the "Field Postamble Keystrokes"
for the very last data field that you have defined in the Wedge: %ea^x%{TAB}%{ }ep
Finally, open a DOS session in a window (not full screen)
and transmit some data from your device.
The data should first pop into the NotePad program and then
be cut from NotePad and pasted into the DOS window.
The keystrokes: "%ea" mean "Alt+e a"
which causes the NotePad program to select all the text in the NotePad Window. The
keystrokes: "^x" mean "Ctrl+x" which causes NotePad to cut the
currently selected text to the clipboard. The keystrokes: "%{TAB}" mean
"Alt+Tab" which causes Windows to switch the focus to the last window that was
active before the NotePad program received the focus (i.e. the DOS window). Finally the
keystrokes: "%{ }ep" mean "Alt+space e p" which opens the control box
in the DOS window and selects "Edit" and "Paste".
The next time you transmit a data record from your device,
the Wedge switch the focus back to the NotePad application automatically and do the same
thing all over again. If you have a reasonably fast PC you will barely notice the NotePad
program popping open in front of your DOS window.
Note: A true DOS version of the Software
Wedge is available that may be better suited for passing data to a DOS application
program. The Software Wedge for DOS is a RAM resident (TSR) program that passes serial
data directly to other DOS programs by stuffing the DOS keyboard buffer. Although it is a
DOS application, it runs extremely well in Windows inside a DOS Window and is an excellent
tool for passing serial data to other DOS based programs.
More Cool Wedge Tricks
|