If you are using Process.Start()
to launch your second exe, then you can pass the icon position as command line arguments in this method like:
Process.Start(@"C:\MyWPFApplication.exe", "50 60");
here assuming MyWPFApplication.exe is your second app and 50,60 are the coordinates you want to launch it on.
Now in App.xaml
of MyWPFApplication, remove the StartUpUri
and in App.xaml.cs
override OnStartup()
method as below to create the main applicatin window and set its Left and Top before showing it:
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
MainWindow window = new MainWindow();
if(e.Args.Length == 2)
{
window.Left = double.Parse(e.Args[0]);
window.Top = double.Parse(e.Args[1]);
}
window.Show();
}