开发者

How to receive handle of second Monitor / Desktop

开发者 https://www.devze.com 2023-04-06 07:30 出处:网络
I found the default desktop function GetDesktopWindow function What how to catch the result for a second monitor?

I found the default desktop function GetDesktopWindow function

What how to catch the result for a second monitor?

* EDIT SOLVED *

<Runtime.Interop开发者_运维百科Services.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

Did the trick.


The Screen class (Windows Forms) could help dealing with multiple monitors.

I.e. use the Screen.AllScreens property to enumerate all monitors.


<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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号