Results 1 to 5 of 5

Thread: How to: File drop on application

  1. #1

    Thread Starter
    Member MaBen's Avatar
    Join Date
    Apr 2000
    Location
    Sherbrooke, Québec, Canada
    Posts
    38

    Question

    if I drop a file on the .exe of my application

    How can I get the file name that I droped.


    Anybody help!

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Say You Want to detect a drop on a picturebox (It doesn't really matter what controll you use but Picture1 is used in the example. Set it's OLEDropMode Property to 1 - Manual then add this code

    Code:
    Private Sub Picture1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim varTemp As Variant
    For Each varTemp In Data.Files
    
        MsgBox varTemp
        
    Next varTemp
    End Sub
    This will give you a message of the filename of each file that's dropped into your picturebox. You can manipulate the files as you like from theire names, not just Message them.

  3. #3

    Thread Starter
    Member MaBen's Avatar
    Join Date
    Apr 2000
    Location
    Sherbrooke, Québec, Canada
    Posts
    38

    Question

    That's working if my application is open! But in my case I want to drop the file on my application (not started) in Windows Explorer

    Thanks Sam Finch

    Anybody Help!

  4. #4
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    I think you Can use Command$ to do that,

    anywhere in Your Code
    Code:
    Msgbox Command$
    Should bring up the name of the file Dropped on it, I'm not sure what it'll do If you drop multible Files on it though. Probably have a big string with the names delimited by commas

  5. #5

    Thread Starter
    Member MaBen's Avatar
    Join Date
    Apr 2000
    Location
    Sherbrooke, Québec, Canada
    Posts
    38

    Talking Big thanks

    Big Thanks Sam Finch

    And the Answer to your question is : a big string and space delimited. The small file format(8.3) is use.

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