tags:

views:

238

answers:

3
A: 

No, you cannot pass unicode characters on the command line without the risk of them being mangled. Pass it a path to a temp file which contains the text (or if you want to get fancy, you could use pipes)

Paul Betts
+1  A: 

You can have your NotificationBalloon.exe read the unicode string from standard input on execution, and use input redirection when spawning it:

public void Foo()
{
    SpawnBalloon("Whatever you want, this can be UNICODE as well.");
}

private void SpawnBalloon(string message)
{
    ProcessStartInfo psi = new ProcessStartInfo("NotificationBalloon.exe")
    {
        RedirectStandardInput = true
    };
    var process = Process.Start(psi);
    process.StandardInput.Write(message);
    process.StandardInput.Flush(); // Might not be necessary if AutoFlush is true
}
Aviad P.
A: 

I ended up passing the UTF-16 values on the command line and converting it to a string inside my main() function. For example:

NotifWindow.exe 00480065006c006c006f0021
will print out "Hello!"

Martin