luapower / winapi

Windows API Lua+ffi binding
http://luapower.com/winapi
63 stars 15 forks source link

IFileDialog Folder selector #35

Open GitSparTV opened 5 years ago

GitSparTV commented 5 years ago

Hello. According to Microsoft manuals, the IFileDialog can have a option FOS_PICKFOLDERS to enable folder selection instead of file.

Can that be accessed by winapi and be a new feature? Thanks sublime_text_2019-02-09_02-07-35

https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifiledialog-setoptions https://docs.microsoft.com/ru-ru/windows/desktop/api/shobjidl_core/ne-shobjidl_core-_fileopendialogoptions

GitSparTV commented 5 years ago

@capr winapi.treeview is broken now as you commented in file, so there's no alternative to make a folder selector by scratch.

capr commented 5 years ago

Note that winapi doesn't use the COM interface to show the file dialog box but standard win32 API. There probably is an option to select a folder with that API too but I haven't checked.

capr commented 5 years ago

Oops, no there isn't. MSDN says: To display a dialog box that allows the user to select a directory instead of a file, call the SHBrowseForFolder function.

GitSparTV commented 5 years ago

@capr I've found this when was searching this question https://stackoverflow.com/questions/8269696/how-to-use-ifiledialog-with-fos-pickfolder-while-still-displaying-file-names-in

He use FOS_PICKFOLDERS