Private Sub lstPlaylist_OLEDragOver(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single, State As Integer)
If (Button = vbLeftButton) Then
DragOpen = False
Else
DragOpen = True
End If
End Sub
Private Sub lstPlaylist_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)
On Error GoTo Drophandler
If (Data.Files.Count > 0) Then
MsgBox ("drag initiated")
For Each DragFile In Data.Files
intstrsearch = InStr(1, DragFile, ".")
Do While (intstrsearch < InStr(intstrsearch + 1, DragFile, "."))
If (intstrsearch < InStr(intstrsearch + 1, DragFile, ".")) Then
intstrsearch = InStr(intstrsearch + 1, DragFile, ".")
End If
Loop
strFileToOpen = Mid(DragFile, intstrsearch + 1, Len(DragFile))
If (strFileToOpen = "mp3" Or strFileToOpen = "mp2" Or strFileToOpen = "m3u" _
Or strFileToOpen = "mpg" Or strFileToOpen = "mpeg" Or strFileToOpen = "mpe" _
Or strFileToOpen = "mlv" Or strFileToOpen = "mpv2" Or strFileToOpen = "mp2v" _
Or strFileToOpen = "mpa" Or strFileToOpen = "cda" Or strFileToOpen = "au" _
Or strFileToOpen = "aif" Or strFileToOpen = "aifc" Or strFileToOpen = "aiff" _
Or strFileToOpen = "ivf" Or strFileToOpen = "wav" Or strFileToOpen = "avi" _
Or strFileToOpen = "mid" Or strFileToOpen = "midi" Or strFileToOpen = "rmi" _
Or strFileToOpen = "wmv" Or strFileToOpen = "wvx" Or strFileToOpen = "wma" _
Or strFileToOpen = "wax" Or strFileToOpen = "asf" Or strFileToOpen = "asx" _
Or strFileToOpen = "wm" Or strFileToOpen = "wmx" Or strFileToOpen = "wmp") Then
strFileToOpen = DragFile
If (DragOpen = False) Then
Call CommandAddFiles
End If
If (DragOpen = True) Then
Call CommandOpenFiles
End If
End If
Next
Data.Files.Clear
End If
Drophandler:
MsgBox ("the drop was lost")
End Sub