C#: writing in another process' console using API (without redirecting it's standard input) : I'm looking for a way to write in another process' console using a WinApi, without redirecting the process' standard input.

Basically, my application (written in C#) is a wrap for another console application. 

This third-party app accepts user commands in its console. My wrap application must start it and write such commands in it's console. Yet I'm restricted to redirect the standard input stream because it causes the thisrd-party application to crash. 

So I'm looking for a solution using an WinAPI, (or other way) for solving this.

Here is a brief part of the code (hoping relevant for to depict what I'm trying to do):

    ProcessStartInfo startInfo = new ProcessStartInfo
    {
        FileName = path
        ,Arguments = string.Join(" ", Args)
        ,UseShellExecute = false
        ,CreateNoWindow = true
        ,RedirectStandardOutput = true
        ,RedirectStandardError = true
        //,RedirectStandardInput = true //This leads the process to crash!
    };
    
    Process myProcess = new Process
    {
        StartInfo = startInfo
    };
    
    myProcess.Start();
    
    /*...*/
    
    public void SendInput(string input)
    {
        //TODO: see how to send input to process' console   
        int result = SendMessage(myProcess.Handle, 0x000C, 0, input + '\n'); // Not working :(
    }


Thanks in advance


