双显示器支持 [英] Dual Monitor Support

查看:105
本文介绍了双显示器支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测用户是否有双显示器,然后我如何控制

显示监控表格。目前我的表格总是出现在

我的右侧显示器上。如果我想让它一直显示在我左边的那个怎么办?


谢谢


解决方案
>如何检测用户是否有双显示器,然后如何控制

显示哪个显示器的显示器。目前我的表格总是在我的右侧显示器上出现
。如果我想让它始终显示在我的左边



一个怎么办?


您可以找到以下帮助 - 转到你的VB帮助文件,选择

搜索选项卡(注意我说SEARCH选项卡)并输入


示例:MULTIMON.EXE


或者可能


文件:MULTIMON.EXE


,具体取决于VB帮助文件的版本。无论如何,选择第一个

列出的文章(至少是我系统中的第一篇);它将以

开头,无论您使用上述搜索字符串。这给你一些

信息和一个链接下载一个评论很多的VB项目名为

Multimon.exe。

Rick - MVP


Rick,


使用你告诉我的VB Sample Monitor.exe似乎有问题。

它成功地知道我有两个监视器。

它成功返回虚拟桌面。


函数GetMonitorFromWindow()总是返回0然后导致

两个按钮监视器我在哪里?和将此表格放在

当前监视器上总是使用我的左主监视器。


我想知道这是否适合你?如果是这样你有任何想法为什么

它对我不起作用。


这个函数总是返回0.


公共函数GetMonitorFromWindow(hwnd As Long,dwFlags As Long)As Long

''=================== ============================== ====

''返回一个监视器句柄窗口(hwnd)在

''================================== =============== ====

Dim lReturn As


On Error GoTo GetMonitorFromWindow_Err
lReturn = MonitorFromWindow(hwnd,dwFlags)

GetMonitorFromWindow = lReturn

退出函数

GetMonitorFromWindow_Err:

如果Err.Number = 453那么

''非多监视器操作系统,返回-1

GetMonitorFromWindow = -1

结束如果

结束功能

谢谢



" Rick Rothstein" < RI ************ @ NOSPAMcomcast.net>在消息中写道

news:h - ******************** @ comcast.com ...

如何检测用户是否有双显示器,然后如何控制显示表格的显示器。目前我的表格总是出现在

我的右侧监视器上。如果我想让它始终显示在我的左侧


一个怎么办?

您可以找到以下帮助 - 转到VB帮助文件,



选择Search选项卡(注意我说SEARCH选项卡)并输入

SAMPLE:MULTIMON.EXE




文件:MULTIMON.EXE

取决于VB帮助文件的版本。无论如何,选择第一篇列出的文章(至少是我系统中的第一篇);它将使用您使用的上述搜索字符串中的任何一个来启动
。这为您提供了一些信息和链接,可以下载一个名为
Multimon.exe的评论很多的VB项目。

Rick - MVP


我害怕除了给你参考之外我不能帮助你。我

我的系统上只有一台显示器。也许有多个显示器的人

将停止此线程,下载Monitor.exe文件并测试

功能。


Rick - MVP

" KJM" < k *** @ cox.net>。在消息中写道

news:ca ******************** @ news2.central.cox.net。 ..

Rick,

使用你告诉我的VB Sample Monitor.exe似乎有问题。

它成功地知道我有两个监视器。
它成功返回虚拟桌面。

函数GetMonitorFromWindow()总是返回一个0然后导致
两个按钮监视器我在哪里是吗?和将此表格放在
电流监视器上总是使用我的左主监视器。

我想知道这是否适合你?如果有的话,你有任何想法
为什么它对我不起作用。

这个函数总是返回0.

公共函数GetMonitorFromWindow(hwnd作为Long,dwFlags As Long)作为
Long''===================================== ============== ====
''返回Window(hwnd)所在的监视器句柄
''======== ========================================= ====
昏暗lReturn As Long

On Error GoTo GetMonitorFromWindow_Err
lReturn = MonitorFromWindow(hwnd,dwFlags)
GetMonitorFromWindow = lReturn
退出函数
GetMonitorFromWindow_Err:
如果Err.Number = 453那么
''非多监视器操作系统,返回-1
GetMonitorFromWindow = -1
结束如果
结束功能

谢谢
Ken

" Rick Rothstein" < RI ************ @ NOSPAMcomcast.net>在消息中写道
新闻:h - ******************** @ comcast.com ...

如何检测用户是否有双显示器,然后如何
控制显示表单的显示器。目前我的表格总是


up on

我的右侧监视器。如果我想让它始终显示在我的左侧


一个怎么办?

您可以找到以下帮助 - 转到VB帮助文件,


选择

搜索选项卡(注意我说SEARCH选项卡)并输入

SAMPLE:MULTIMON.EXE

或可能

文件:MULTIMON.EXE

取决于VB帮助文件的版本。无论如何,选择第一篇列出的文章(至少是我系统中的第一篇);它将以

您使用的上述搜索字符串中的任何一个开始


。这为您提供了一些信息和链接,可以下载一个名为
Multimon.exe的评论很多的VB项目。

Rick - MVP



How can I detect if the user has dual monitors and then how do I control
which monitor a form is displayed on. Currently my forms always come up on
my right monitor. What if I want to have it always display on my left one?

Thanks
Ken

解决方案

> How can I detect if the user has dual monitors and then how do I control

which monitor a form is displayed on. Currently my forms always come up on my right monitor. What if I want to have it always display on my left


one?

You may find the following of some help -- go to your VB Help Files, select
the Search tab (note I said SEARCH tab) and type in

SAMPLE: MULTIMON.EXE

or possibly

FILE: MULTIMON.EXE

depending on the version of your VB Help files. Anyway, select the first
listed article (at least its the first one on my system); it will start with
whichever of the above search strings you used. This gives you some
information and a link to download a heavily commented VB project called
Multimon.exe.
Rick - MVP


Rick,

Using the VB Sample Monitor.exe you told me about seems to have a problem.

It successfully knows I have two Monitors.
It successfully returns the virtual desktop.

The function GetMonitorFromWindow() always returns a 0 which then causes the
two buttons "Where is the Monitor I''m On?" and "Center this Form on the
Current Monitor" to always use my left Primary Monitor.

I was wondering if this works for you? And if so do you have any ideas why
it wouldn''t work for me.

This function always returns a 0.

Public Function GetMonitorFromWindow(hwnd As Long, dwFlags As Long) As Long
''================================================= ====
''Returns a monitor handle that the Window (hwnd) is in
''================================================= ====
Dim lReturn As Long

On Error GoTo GetMonitorFromWindow_Err
lReturn = MonitorFromWindow(hwnd, dwFlags)
GetMonitorFromWindow = lReturn
Exit Function
GetMonitorFromWindow_Err:
If Err.Number = 453 Then
''Non-Multimonitor OS, return -1
GetMonitorFromWindow = -1
End If
End Function
Thanks
Ken
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:h-********************@comcast.com...

How can I detect if the user has dual monitors and then how do I control
which monitor a form is displayed on. Currently my forms always come up on

my right monitor. What if I want to have it always display on my left


one?

You may find the following of some help -- go to your VB Help Files,


select the Search tab (note I said SEARCH tab) and type in

SAMPLE: MULTIMON.EXE

or possibly

FILE: MULTIMON.EXE

depending on the version of your VB Help files. Anyway, select the first
listed article (at least its the first one on my system); it will start with whichever of the above search strings you used. This gives you some
information and a link to download a heavily commented VB project called
Multimon.exe.
Rick - MVP



I''m afraid I can''t help you beyond giving you the reference that I did. I
only have one monitor on my system. Perhaps someone with multiple monitors
will stop by this thread, download the Monitor.exe file and test that
function out for you.

Rick - MVP
"KJM" <k.***@cox.net> wrote in message
news:ca********************@news2.central.cox.net. ..

Rick,

Using the VB Sample Monitor.exe you told me about seems to have a problem.

It successfully knows I have two Monitors.
It successfully returns the virtual desktop.

The function GetMonitorFromWindow() always returns a 0 which then causes the two buttons "Where is the Monitor I''m On?" and "Center this Form on the
Current Monitor" to always use my left Primary Monitor.

I was wondering if this works for you? And if so do you have any ideas why it wouldn''t work for me.

This function always returns a 0.

Public Function GetMonitorFromWindow(hwnd As Long, dwFlags As Long) As Long ''================================================= ====
''Returns a monitor handle that the Window (hwnd) is in
''================================================= ====
Dim lReturn As Long

On Error GoTo GetMonitorFromWindow_Err
lReturn = MonitorFromWindow(hwnd, dwFlags)
GetMonitorFromWindow = lReturn
Exit Function
GetMonitorFromWindow_Err:
If Err.Number = 453 Then
''Non-Multimonitor OS, return -1
GetMonitorFromWindow = -1
End If
End Function
Thanks
Ken
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:h-********************@comcast.com...

How can I detect if the user has dual monitors and then how do I control which monitor a form is displayed on. Currently my forms always come

up on

my right monitor. What if I want to have it always display on my left


one?

You may find the following of some help -- go to your VB Help Files,


select

the Search tab (note I said SEARCH tab) and type in

SAMPLE: MULTIMON.EXE

or possibly

FILE: MULTIMON.EXE

depending on the version of your VB Help files. Anyway, select the first
listed article (at least its the first one on my system); it will start


with

whichever of the above search strings you used. This gives you some
information and a link to download a heavily commented VB project called
Multimon.exe.
Rick - MVP




这篇关于双显示器支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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