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
精彩评论