I have an WPF application. For fast launching the keyboard in my app, I want to start Keyboard process and application in the same time. For this I added to MainViewModel() my function StartKeyboardProcess() with next description:
string keyboardPath = ConfigurationManager.AppSettings["KeyboardPath"];
ProcessStartInfo startInf = new ProcessStartInfo();
startInf.FileName = keyboardPath;
//startInf.WindowStyle = ProcessWindowStyle.Hidden;
startInf.UseShellExecute = false;
startInf.CreateNoWindow = false;
startInf.RedirectStandardOutput = true;
startInf.Arguments = Model.AppCulture.ToString() + " " + Model.AccountWithPhoneAbility.ToString();
KeyboardProcess = Process.Start(startInf);
KeyboardProcess.EnableRaisingEvents = true;
KeyboardProcess.Exited += keyboardProcess_Exited;
KeyboardProcess.OutputDataReceived += KeyboardProcess_OutputDataReceived;
KeyboardProcess.BeginOutputReadLine();
//It's my debug file
<add key="KeyboardPath" value="D:\Kickle\LyncBox-Dev\LyncBox.Tool.KickleKeyBoard\bin\Release\LyncBox.Tool.KickleKeyBoard.exe" xdt:Transform="Insert"/>
I want to hide the window of KeyboardProcess, but I didn't manange to do this.
I tried all the way like CreateNoWindow, ProcessWindowStyle.Hidden,
but it doesn't work for me. Help me! Thanks.