Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
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
Posted
Updated 6-Dec-10 18:48pm
v4
Comments
Rajesh Anuhya 1-Dec-10 1:55am    
Playing movies from Dos??.., Using what????
Dalek Dave 1-Dec-10 5:48am    
Edited for Grammar and Readability.

Hi prashantwamane,

Your code needs inter process communication. So you can use .Net remoting for this.

V.Vishal
 
Share this answer
 
Comments
Rajesh Anuhya 1-Dec-10 1:48am    
How remoting will work.., can you explain it more..
For this you need to create the process for each command.

For example:
System.Diagnostics.Process play = new System.Diagnostics.Process();
and provide the arguemnts to play and call play.start().
when you want to stop call play.close()
 
Share this answer
 
v2
Comments
Dalek Dave 1-Dec-10 5:48am    
Good Call.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900