启动应用程序并将其发送到第二台显示器 [英] Launch an application and send it to second monitor

查看:28
本文介绍了启动应用程序并将其发送到第二台显示器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 VB 2008 中,我使用类进程"来启动和外部应用程序,并带有一些参数.有人知道如何以编程方式将其发送到第二台显示器吗?

In VB 2008, I am using the class 'process' to launch and external application with a few parameters. Does anybody knows how can I send it programmatically to second monitor?

另外,有没有办法知道激活了多少显示器?

Also, is there any way to know how many monitors are activated?

谢谢.

推荐答案

您可以在不同的屏幕上找到您的表单.

You can locate your form on a different screen.

form.Location = Screen.AllScreens(1).Bounds.Location + new Point(100, 100)

启动应用程序时,使用进程句柄获取窗口 (hWnd).windows API 使用的就是这个 hWnd 值.

When you launch an application, use the Process Handle to get the Window (hWnd). It's this hWnd value that windows API uses.

您将需要使用从 User32.dll 导入的 SetWindowRect 方法(见最后一个链接)

You will need to use the SetWindowRect method imported from User32.dll (see last link)

另见

这篇关于启动应用程序并将其发送到第二台显示器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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