.net 如何接收第二个监视器/桌面的句柄

.net 如何接收第二个监视器/桌面的句柄,.net,api,screen,desktop,monitor,.net,Api,Screen,Desktop,Monitor,我找到了默认的桌面功能 如何捕捉第二个监视器的结果 *编辑已解决* 成功了。Windows窗体可以帮助处理多个监视器 例如,使用枚举所有监视器。Windows窗体可以帮助处理多个监视器 <Runtime.InteropServices.DllImport("user32.dll", CharSet:=Runtime.InteropServices.CharSet.Auto, ExactSpelling:=True)> _ Public Shared Function Window

我找到了默认的桌面功能

如何捕捉第二个监视器的结果

*编辑已解决*

成功了。Windows窗体可以帮助处理多个监视器

例如,使用枚举所有监视器。

Windows窗体可以帮助处理多个监视器

<Runtime.InteropServices.DllImport("user32.dll", 
CharSet:=Runtime.InteropServices.CharSet.Auto, ExactSpelling:=True)> _
Public Shared Function WindowFromPoint(ByVal x As Integer, ByVal y As Integer) 
As IntPtr
End Function

即,使用枚举所有监视器。

监视器不是桌面。它可能是桌面的一部分,这是真的。但是GetDesktopWindow用于接收GetDeviceCaps的数据,并返回使用第二个监视器的错误句柄。但我现在解决了。谢谢你的信息。但是你怎么知道x和y给它什么,所以你得到了第二个显示器?显示器不是桌面。它可能是桌面的一部分,这是真的。但是GetDesktopWindow用于接收GetDeviceCaps的数据,并返回使用第二个监视器的错误句柄。但我现在解决了。谢谢你的信息。但是你怎么知道x和y应该给它什么,这样你就可以得到第二个监视器呢?不,因为我读文档时无法在那里收到句柄。不,因为我读文档时无法在那里收到句柄。
<Runtime.InteropServices.DllImport("user32.dll", 
CharSet:=Runtime.InteropServices.CharSet.Auto, ExactSpelling:=True)> _
Public Shared Function WindowFromPoint(ByVal x As Integer, ByVal y As Integer) 
As IntPtr
End Function