This question is relative to the ms windows api.
Found SHBrowseForFolder function in the oldwinapi module to build a dialog to select a folder. Needed that since GetOpenFileName only selects files. That works, but requires selection to always begin at the very topmost master root.
To specify the selection root in SHBrowseForFolder requires an ITEMIDLIST for that root. This seems to be some kind of generalized internal filesystem path.
How do I convert an ordinary file path string (e.g. C:\Moo\Gai\Folly) into such an ITEMIDLIST?
The function ParseDisplayName might do that, but I cannot find it in the oldwinapi module?
Or is there some old-style winapi for a gui to select a folder??
Thanks
nimble install dialogs
import dialogs
let dir = chooseDir(nil, r"C:\start\here")
echo dir, " has been picked"
I wish I had noticed the dialogs module earlier - it would have saved me much wheel reinvention. However I do not see how the chooseDir proc is using its root parameter when not defined(windows).
I've also decided that the GTK approach is more beginner friendly in that the choose folder dialog is very similar to the open file dialog - except that file names are gray-ed out. I may try to emulate that in winapi - except I am not sure how to disable those file names.
Thanks for the tip.