Originally posted by Megatron
Question 3:
You can make your own with a few API calls. Add to a Form with a
Timer and 3
Labels.
Code:
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 GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Form_Load()
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
Dim hWnd_Window As Long
Dim sClassName As String * 255
Dim sWindowName As String * 255
Dim iLength As Integer
Dim PT As POINTAPI
GetCursorPos PT
hWnd_Window = WindowFromPoint(PT.x, PT.y)
iLength = GetClassName(hWnd_Window, sClassName, 255)
sClassName = Left(sClassName, InStr(1, sClassName, vbNullChar))
iLength = GetClassName(hWnd_Window, sWindowName, 255)
sWindowName = Left(sWindowName, InStr(1, sWindowName, vbNullChar))
Label1 = hWnd_Window 'Display the hWnd
Label2 = sClassName 'Display the class name
Label3 = sWindowName 'Display the window name
End Sub
[/B]