I read many answers on how to send command to cmd prompt.
But I do not want to use StreamWriter or similar stuff to input and get output.
I want to use SendMessage to send my string or say command to the cmd prompt window.
Can anyone please help on this?
Just to give detail about my application.
1. My application is a WinForm App.
2. It has 4-5 buttons.
3. Button1 opens the command prompt window while Button5 closes or exits the command prompt window.
4. Button 2,3,4 are command buttons. When user clicks the Button2 command 1 is send to command prompt window. Similar when button 3 and 4 are clicked command 2 and command 3 are sent to the same command prompt window.
Let me know if anybody has a written code which sends string to command prompt.
Thanks and regards,
Rahul
I have got the solution.
I used PostMessage().
Cmd has handle and you can send string to it.
I was just struggling to find the right way to get the handle.
Now I got one.
Thanks to all!