如何接收第二台Monitor / Desktop的句柄

时间:2011-09-19 08:53:24

标签: .net api screen desktop monitor

我找到了默认的桌面功能 GetDesktopWindow function

如何捕获第二台显示器的结果?

*编辑已解决*

<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

诀窍。

2 个答案:

答案 0 :(得分:2)

Screen class(Windows窗体)可以帮助处理多个监视器。

即。使用Screen.AllScreens property枚举所有监视器。

答案 1 :(得分:2)

<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