Results 1 to 4 of 4

Thread: Drag and drop URLs

  1. #1
    Guest

    Post

    I just added drag and drop support for local files. It is realy great. Now I want to be able to drag a link from IE, I am not worried about Netscape as much, into my program and be able to take the link. I have seen it done in download managers like Getright. I know it can be done. Any ideas?

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    set your form's OLEDropMode to manual and use this code to get the URL

    Code:
    Private Sub Form_OLEDragDrop(Data As DataObject, _
    Effect As Long, Button As Integer, _
    Shift As Integer, X As Single, Y As Single)
        
        MsgBox Data.GetData(vbCFText)
        
    End Sub

  3. #3
    Guest

    Post

    That is realy great. I had drag and drop support for files as well, is there a way to integrate the two? When I drag a file from my desktop it says it is the wrong type. If there isn't a way I will just have to put this part on a seperate, small, form. Thanks again!

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    try this for the code in the same event:

    Code:
        If Data.GetFormat(vbCFText) = True Then
            MsgBox Data.GetData(vbCFText)
        ElseIf Data.GetFormat(vbCFFiles) = True Then
            
            'do something
        End If
    You can use any of the ClipBoardConstants to check what type of item is being dropped.

    Tom

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width