Update PathRequester() to use IFileDialog on Windows

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
NilsH
User
User
Posts: 13
Joined: Sun Apr 16, 2017 8:46 pm
Location: Germany

Update PathRequester() to use IFileDialog on Windows

Post by NilsH »

Hello!

I noticed that as of PureBasic 6.03 PathRequester() still uses the old "Open Folder" dialog, even though there is a new and much more user-friendly dialog available since Windows Vista. This new dialog looks like the dialog used by OpenFileRequester() and SaveFileRequester().
As far as I know, this new dialog is available through the IFileDialog interface, but I couldn't try it out myself because I don't know how to use COM in PureBasic.

If possible, please change PathRequester() to use the new dialog on Windows!

Apparently it is necessary to call IFileDialog::SetOptions() and add FOS_PICKFOLDERS to the options in order to switch IFileDialog into folder selection mode. But again, I haven't tried this myself.

Some (hopefully helpful) documentation on this topic:
https://learn.microsoft.com/en-us/windo ... ile-dialog
https://learn.microsoft.com/en-us/windo ... filedialog
https://learn.microsoft.com/en-us/windo ... setoptions
https://learn.microsoft.com/en-us/windo ... logoptions

Thanks,
Nils
Quin
Addict
Addict
Posts: 1131
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Update PathRequester() to use IFileDialog on Windows

Post by Quin »

+1
Axolotl
Addict
Addict
Posts: 804
Joined: Wed Dec 31, 2008 3:36 pm

Re: Update PathRequester() to use IFileDialog on Windows

Post by Axolotl »

maybe you should look at this.
Select folder dialog
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
NilsH
User
User
Posts: 13
Joined: Sun Apr 16, 2017 8:46 pm
Location: Germany

Re: Update PathRequester() to use IFileDialog on Windows

Post by NilsH »

Axolotl wrote: Tue Nov 07, 2023 3:42 pm maybe you should look at this.
Select folder dialog
Thanks! I will check this out.

However, I still think that PathRequester() should be updated, given that the new dialog was introduced 17 years ago.
Post Reply