激活一个父窗口 [英] Activate a parent window

查看:54
本文介绍了激活一个父窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows窗体程序,该程序生成一个子进程(.exe).执行后,子级将成为活动窗口.如何将控件返回给父级,以便以编程方式使其成为活动窗口.

I have a Windows form program that spawns a child process(.exe). Upon execution the child becomes the active window. How can I return control to the parent so that it is the active window programatically.

推荐答案

Me.Activate()



当然,您只能在子.EXE启动后执行该行代码,如其主窗口所示.查看Process类的文档,您将看到一个名为"WaitForInputIdle"的方法.



Of course, you can only execute that line of code after the child .EXE launches as shows its main window. Look at the documentation on the Process class and you''ll see a method called "WaitForInputIdle".


这篇关于激活一个父窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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