3
Answers

How to pass commands to MS-DOS through the front end by a button click

prashant wamane

prashant wamane

13y
12.5k
1
Hi Friends,

I have developed the front end in a c# windows application.

However, I am playing a movie in command prompt i.e. (cmd.exe). Here i am able to view the entire data streams in command prompt i.e. how much part of the data is played? and how much data is remaining? and other things. Apart from this, i am able to do various operations on it like pause, stop and seek to a particular time using the keyboard. Now, I want to control the command prompt from my front end which is an windows application i.e. I need to pass the commands by the button click, like i want to pause, stop and scroll the movie which is playing in the command prompt.

I tried using various methods of c# like sendkey, sendmessage etc, but those are applied only to the active windows and whenever I click the button of my front end the command prompt becomes inactive and the front end becomes an active window, so these methods are not applicable.

Is there any method in c# wherein I will be able to generate the keyboard interrupt through software without actually pressing the keyboard?

This is where I am stuck.

The best example would be the on-screen keyboard wherein I can click on the button on the screen and it is passing the commands to the dos.
The exactly similar kind of application I want to use where I am having the buttons on my front end and I want to send commands to the dos.

Kindly reply soon as possible.

Thank you,
prashant wamane
Answers (3)