C#程序开始重点问题 [英] C# process start focus issue

查看:145
本文介绍了C#程序开始重点问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

结果
当我开始一个新的进程,它会自动获得焦点。我怎么能阻止它获得焦点或替代找回焦点我的应用程序?


When I start a new process, it automatically gets the focus. how can I prevent it from getting the focus or instead get back the focus to my application?

下面是我使用的代码:

string path = @"c:\temp\myprocess.exe";  
ProcessStartInfo info = new ProcessStartInfo(path);  
info.WorkingDirectory = path;  
Process p = Process.Start(info);  



我只需要执行的过程中没有得到焦点。

I just need the executed process not to get the focus.

非常感谢你,结果
阿迪巴尔达

Thank you very much,
Adi Barda

推荐答案

您可以做

myForm.Focus();

其中myForm会在你的主应用程序

where myForm is the form on your main application

这篇关于C#程序开始重点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆