Aplikasi API untuk mengirim Pesan

Tuesday, May 31, 2011 | 11:23 AM|


API Explanation
N/A

Parameter Information
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As _
Long, ByVal wMsg As Long, ByVal wParam As _
Long, lParam As Any) As Long

Kode :

Private Sub File1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim ItemHeight As Long
Dim NewIndex As Long
Static OldIndex As Long

With File1
ItemHeight = SendMessage(.hWnd, LB_GETITEMHEIGHT, 0, ByVal 0&)
ItemHeight = .Parent.ScaleY(ItemHeight, vbPixels, vbTwips)
NewIndex = .TopIndex + (y \\ ItemHeight)
If NewIndex <> OldIndex Then
If NewIndex < .ListCount Then
.ToolTipText = .List(NewIndex)
Else
.ToolTipText = vbNullString
End If
OldIndex = NewIndex
End If
End With
End Sub

0 comments: