I have a launching application that uses Process.Start("MyExe")
to open another one of my applications, which is stored in an executable, and presents a WPF window.
However I also want to be able to set the position of the WPF on the screen from within the launcher program. I have tried using MoveWindow
but it's not working.
Process flash = new Process();
flash.StartInfo.FileName = appDirectoryPath + "\\" + OnScreenKeyboardExe;
flash.Start();
Thread.Sleep(100);
IntPtr id = flash.MainWindowHandle;
File.WriteAllText("D://errorlog.txt", id.ToString());
OperatingSystemBase.MoveWindow(flash.MainWindowHandle, 1000, 1000, 500, 500, true);
in errorlog file I got id 0. So may be I am not able to get process or something.