Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Is there a way to use the windows' default file/folder selector?  (Read 302 times)

0 Members and 1 Guest are viewing this topic.

somevan

  • Newbie
  • *
  • Posts: 1
    • View Profile
Im currently making a program, about editing json files. Is there a way to open the default windows file selector, and is it possible to make it open folders as well? I haven't found anything about this topic on the internet, so it would be really useful to know. I don't want to use the default WinAPI's choose file window, because it would only work in windows. Thanks in advance!
« Last Edit: March 28, 2024, 03:20:56 pm by somevan »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
Re: Is there a way to use the windows' default file/folder selector?
« Reply #1 on: March 28, 2024, 04:17:51 pm »
No, SFML doesn't offer such a functionality, but there are various libraries that have implemented this in some way or another.

https://github.com/mlabbe/nativefiledialog
https://sourceforge.net/projects/tinyfiledialogs/
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kojack

  • Sr. Member
  • ****
  • Posts: 331
  • C++/C# game dev teacher.
    • View Profile
Re: Is there a way to use the windows' default file/folder selector?
« Reply #2 on: March 28, 2024, 06:15:06 pm »
I use Portable File Dialogs: https://github.com/samhocevar/portable-file-dialogs
It's a single header only library that supports windows, mac and linux.
It can do file open/save and folder selection dialogs, plus message boxes and notifications.