if I drop a file on the .exe of my application
How can I get the file name that I droped.
Anybody help!
Printable View
if I drop a file on the .exe of my application
How can I get the file name that I droped.
Anybody help!
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
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.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
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!
I think you Can use Command$ to do that,
anywhere in Your CodeShould 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 commasCode:Msgbox Command$
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.