你能在最上面的窗口上启动一个进程吗?(csharp wpf)我有以下内容,但是在此之前的当前窗口(使用具有 topmost=true 的窗口类的 wpf 窗口)在启动进程时仍然位于进程的顶部。
if (System.IO.File.Exists(MY_CALC_PATH))
{
System.Diagnostics.Process helpProcess = new System.Diagnostics.Process();
helpProcess.StartInfo.FileName = "calc.exe";
helpProcess.Start();
helpProcess.WaitForInputIdle();
BringWindowToTop(helpProcess.MainWindowHandle);
SetWindowPos(helpProcess.MainWindowHandle, myCurrentTopmostWinHnd, 0, 0, 0, 0, SWP_NOSIZE_);
}