?
Solved

Faking Keyboard Input to a CMD window

Posted on 1997-03-06
2
Medium Priority
?
1,280 Views
Last Modified: 2013-12-03
Does anyone know how to send keystrokes to a CMD windows under Win32 (Windows NT).  I need to be able to send keystrokes to a legacy MSDOS application from another Win32 application, and I also need to be able to examine the screen buffer output from the DOS App.

The Dos app does direct writes to the screen.

Thanks.
0
Comment
Question by:ptan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
Irene012397 earned 70 total points
ID: 1298665
If you don't mind your actions to be widely visible, place the keys on clipboard and send alt-space, e, p.

To read the screen, send alt-space, e, m, a lot of shift-arrows and alt-space, e, c.

I think there is no other easy way to communicate with normal DOS windows.
0
 

Expert Comment

by:lightningstalker
ID: 22013121
Most times you can do this using redirection like this:

dosapp < keyboardinputfile > output
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

649 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