Código
Private Type POINTAPI X As Long Y As Long End Type Private Declare Function GetClassName Lib "user32" Alias _ "GetClassNameA" ( _ ByVal hwnd As Long, _ ByVal lpClassName As String, _ ByVal nMaxCount As Long) As Long Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long Dim Mouse As POINTAPI
en un timer interval 100
Código
Private Sub Timer1_Timer() Dim sClass As String * 255 Dim lhWnd As Long Dim lRetVal As Long Dim classdettect As String Call GetCursorPos(Mouse) lRetVal = GetClassName(lhWnd, sClass, 255) Me.Cls Text1.Text = sClass Me.Print "Posicion del cursor :" Me.Print "X:" + Str$(Mouse.X) + vbCrLf + "Y:" + Str$(Mouse.Y) end sub