hello i used this vb6 code in order to get the handle of any window from a point.
now the problem is that this code seems not to work with vb.net.VB Code:
Dim myhwnd As Long Dim typPt As POINTAPI Dim hwnd As Long typPt.x = MY_X typPt.y = MY_Y myhwnd = WindowFromPoint(typPt.x, typPt.y)
I could get a handle to any window even if it did not belong to the form.
Now the following code can find the handle a control that does only exist on the form ,i think. Is there a way to get a handle to any control of any windows window ?
thanks !
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim pt As System.Drawing.Point pt.X = 500 pt.Y = 100 Dim co As Control co = Me.GetChildAtPoint(pt) If Not co Is Nothing Then MsgBox(co.Name) Else MsgBox("NO CONTROL FOUND", MsgBoxStyle.ApplicationModal) End If End Sub




Reply With Quote