'Get the caption of control which captures mouse event using GetCapture API
'Get the caption of control which captures mouse event using GetCapture API
API Declarations
Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal length As Long) As Long
Private Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Rate 'Get the caption of control which captures mouse event using GetCapture API
(2(2 Vote))
'Visit my Homepage at
'http://www.geocities.com/marskarthik
'http://marskarthik.virtualave.net
'Email: [email protected]
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 5
End Sub
Private Sub Timer1_Timer()
Dim hWnd As Long
Dim wntxt As String
Dim length As Long
hWnd = GetCapture()
If hWnd Then
length = GetWindowTextLength(hWnd) + 1
wntxt = Space(length)
length = GetWindowText(hWnd, wntxt, length)
wntxt = Left(wntxt, length)
Label1.Caption = wntxt & " has captured the mouse"
End If
End Sub
'Get the caption of control which captures mouse event using GetCapture API Comments
No comments yet — be the first to post one!
Post a Comment