I searched for solution in the forum, since I realised some other people had the same issue, but after trying the “solutions”, it is still not working.
This is working perfectly on a Mac, but it doesn’t work on Windows.
I need to drag files from the Finder/Explorer into a ListBox (I just need to get their filenames).
I added a special/any FileType to the app and in the Open event of the ListBox, I added Me.AcceptFileDrop(DropTypes.All)
In the DropObject event, I have:
if obj.FolderItemAvailable = True then…
The Windows Privileges are set to User, for the build.
This all works perfectly on the Mac, but I get a red stop sign when I try to drag any files into the ListBox, in Windows.
How can I make it work?
And getting two times the same question in a couple of days seems suspect.
At last, the File Type feature wad added for good reason.
Displaying what a file is is beyond that reason.
Using special/any is not the panacea.
You still will have to write code to explain what the dropped file is. So adding File Type for each item you want to deal with is still a good idea: it allow you to do what you want:
if f.Type = “plain/text” Then
// display what a plain text file is
Else…
Of the use of Select Case:
Select f.Type
Case “plain/text”
Of course, you have to match File Types to the code.
I understand that.
The problem is that it could really be any file, because this is an app to manage filenames. So, the file type is really not important and it should receive ALL types of files.
As far as I’m aware, it’s not documented, because Windows.
Technically * works too as . is optional but you should really use *.* as that is the wildcard for all files with all extensions and a user in windows would expect to see that in their file dialogs types under All Files.
As I alter/user them so infrequently I always cringe when I have to look at UserGuide:File Type Group Editor - Xojo Documentation as its just a wall of text. Macos only stuff is mixed in with general stuff, like mime types are macos only so why aren’t they in the macos only section and Windows things are wrong like “only the extensions need to be specified in order for file dialogs to limit the selection of files” when its clearly also needed for drag and drop.