Hi all,
I'm having a trouble with openening the JMP window when JMP process is running as background process.
Once this process is killed, everything works fine.
Is there way make automation work without manually killing this process?
Thanks,
Greg
Thank you @ChrisM!
It's very close to what I needed.
Our users may want to keep JMP in foreground open. So I just need to find background processes.
With replacing foreach loop:
//if having trouble attaching to JMP, then start fresh, kill all JMP processes and try again!
foreach (var process in Process.GetProcessesByName("jmp"))
{
DialogResult d = MessageBox.Show("All JMP windows will be closed, please save files prior to clicking YES!!! Click NO, to disable JMP functionality, and leave JMP open", "JMP Warning", MessageBoxButtons.YesNo);
if (d != DialogResult.Yes)
{
//this.Shown += new EventHandler(MyForm_CloseOnStart);
return false;
}to:
//Kill all the JMP processes in background
foreach (var process in Process.GetProcessesByName("jmp"))
{
if (process .MainWindowHandle == IntPtr.Zero)
{
process .Kill();
}
}
System.Threading.Thread.Sleep(200);it works like charm.
