VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "IDropTargetClass"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' Calaym - Media player GUI for sound systems
' Copyright (C) 2002-2012 Jan Vorel
'
' You can redistribute the official software packages under the terms of the
' User-friendly Open-source License Version 1.00, published by Jan Vorel
'
' You can use this software under the terms of the
' User-friendly Software License Version 1.00, published by Jan Vorel
'
' You should have received copies of the licenses along with this program. If
' not, contact the author.
'
' If you want to use or distribute this software under a different license, ask
' the author.
'
' The software is provided "as is" without warrenty of any kind. The Licensor
' cannot be held responsible for any damage caused by using, extracting or
' installing the software.

Option Explicit

#Const SmallerOLE_shlext = False

Implements IDropTarget

Private xCallProc As Long
Private xGrfKeyState As Long
'Private Declare Function OleGetData Lib "olecli32.dll" (ByVal lpoleobject As Long, ByVal oleclipformat As Integer, ByRef pHandle As Long) As Long

#If SmallerOLE_shlext Then
Private Sub IDropTarget_DragEnter(ByVal pDataObj As shlext.IDataObject, ByVal grfKeyState As Long, ByVal ptX As Long, ByVal pyY As Long, pdwEffect As shlext.DROPEFFECTS)
#Else
Private Sub IDropTarget_DragEnter(ByVal pDataObj As olelib.IDataObject, ByVal grfKeyState As Long, ByVal ptX As Long, ByVal ptY As Long, pdwEffect As olelib.DROPEFFECTS)
#End If
  pdwEffect = 4& '4 link, 2for shift/move, 1 for copy
  xGrfKeyState = grfKeyState
  End Sub

Private Sub IDropTarget_DragLeave()
  '
  End Sub

#If SmallerOLE_shlext Then
Private Sub IDropTarget_DragOver(ByVal grfKeyState As Long, ByVal ptX As Long, ByVal ptY As Long, pdwEffect As shlext.DROPEFFECTS)
#Else
Private Sub IDropTarget_DragOver(ByVal grfKeyState As Long, ByVal ptX As Long, ByVal ptY As Long, pdwEffect As olelib.DROPEFFECTS)
#End If
  If grfKeyState = &HF0F00F0F Then xCallProc = ptX
  pdwEffect = 4&
  xGrfKeyState = grfKeyState
  End Sub

#If SmallerOLE_shlext Then
Private Sub IDropTarget_Drop(ByVal pDataObj As shlext.IDataObject, ByVal grfKeyState As Long, ByVal ptX As Long, ByVal ptY As Long, pdwEffect As shlext.DROPEFFECTS)
#Else
Private Sub IDropTarget_Drop(ByVal pDataObj As olelib.IDataObject, ByVal grfKeyState As Long, ByVal ptX As Long, ByVal ptY As Long, pdwEffect As olelib.DROPEFFECTS)
#End If
  'Dim Idx As Long
  Dim xType1 As FORMATETC
  Dim xType2 As STGMEDIUM
 
  xType1.cfFormat = 15&
  xType1.lindex = -1&
  'xType1.pDVTARGETDEVICE = 0&
  xType1.dwAspect = 1&
  xType1.TYMED = TYMED_HGLOBAL
  xType2.TYMED = TYMED_HGLOBAL
  If pDataObj.GetData(xType1, xType2) = 0& Then
    Call CallWindowProcA(xCallProc, xType2.Data, 0&, 0&, xGrfKeyState)
    End If
  pdwEffect = 4&
  End Sub
