' Delcarations
Private Declare Function GetKeyState Lib "user32.dll" (ByVal nVirtKey As Long) As Integer
Private Const VK_LEFT As Long = &H25
' sample usage, change Picture1 to your object that is being dragged
Private Sub Picture1_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
' change effects as needed
AllowedEffects = vbDropEffectCopy Or vbDropEffectMove
Data.Clear
Data.SetData , vbCFFiles ' by not actually populating data, we get the SetData event
End Sub
Private Sub Picture1_OLESetData(Data As DataObject, DataFormat As Integer)
If GetKeyState(VK_LEFT) > -1 Then ' test for left mouse button up (user made decision)
' unzip/transfer files to user's temp path.
' else unzip/transfer files to other writable path
' now add the temp path/filenames to the data object
' i.e., Data.Files.Add ....
End If
End Sub
Private Sub Picture1_OLECompleteDrag(Effect As Long)
' clean up the temp path/files. Remove them
If Effect = vbDropEffectMove Then
' remove these from your server if you offered that option
End If
End Sub