[DllImport("user32.dll")]
static extern IntPtr WindowFromPoint(POINT Point);
The WindowFromPoint function retrieves a handle to the window that contains the specified point.
Please add some!
[DllImport("user32.dll")]
static extern IntPtr WindowFromPoint(POINT Point);
[DllImport("user32.dll")]
static extern bool GetCursorPos(out Point lpPoint);
[DllImport("user32.dll")]
static extern bool SetWindowText(IntPtr hWnd, string lpString);
Point p;
if (GetCursorPos(out p))
{
IntPtr hWnd = WindowFromPoint(p);
SetWindowText(hWnd, "Window Found");
}
Do you know one? Please contribute it!
Imports System.Runtime.InteropServices
Module test
<DllImport("user32.dll")> _
Function WindowFromPoint(ByVal xyPoint As POINT) As Long
End Function
end module
xPoint, yPoint
The WindowFromPoint function retrieves a handle to the window that contains the specified point.
Please add some!
Dim tPA As Point
Dim lhWnd As Long
tPA = Cursor.Position
' Get window handle from point
lhWnd = WindowFromPoint(tPA)
Do you know one? Please contribute it!