;Autor: ts-soft, srod ;http://www.purebasic.fr/english/viewtopic.php?p=322421#p322421 EnableExplicit Procedure.s PathRequesterEx(Title.s, InitialPath.s = "", CSIDL = #PB_Default, Flags = 0) Protected.ITEMIDLIST *ppidl Protected.BROWSEINFO Dir Protected result Protected.s folder = Space(#MAX_PATH) Protected *Path, t1$ CoInitialize_(#Null) If CSIDL = #PB_Default *Path = AllocateMemory(StringByteLength(InitialPath, #PB_Unicode) + 2) PokeS(*Path, InitialPath, -1, #PB_Unicode) *ppidl = ILCreateFromPath_(*Path) FreeMemory(*Path) Else SHGetSpecialFolderLocation_(GetActiveWindow_(), CSIDL, @*ppidl) EndIf With Dir \hwndOwner = GetActiveWindow_() \pidlRoot = *ppidl \pszDisplayName = @folder \lpszTitle = @Title \ulFlags = Flags EndWith result = SHBrowseForFolder_(@dir) If result And Dir\pszDisplayName t1$ = Folder SHGetPathFromIDList_(result, @Folder) If Folder = "" Folder = t1$ EndIf CoTaskMemFree_(result) EndIf CoTaskMemFree_(*ppidl) CoUninitialize_() If Folder If FileSize(Folder) = -2 If Right(Folder, 1) <> "\" : Folder + "\" : EndIf EndIf EndIf ProcedureReturn Folder EndProcedure Debug PathRequesterEx("Select savedir:", "", #CSIDL_PERSONAL) Debug PathRequesterEx("Select PureBasic Source:", #PB_Compiler_Home + "Examples\Sources\", #PB_Default, #BIF_BROWSEINCLUDEFILES) Debug PathRequesterEx("Select Printer:", "", #CSIDL_PRINTERS, #BIF_BROWSEFORPRINTER | #BIF_NEWDIALOGSTYLE | #BIF_NONEWFOLDERBUTTON) ; IDE Options = PureBasic 5.31 (Windows - x64) ; Folding = - ; EnableUnicode ; EnableXP ; EnableUser ; EnableCompileCount = 0 ; EnableBuildCount = 0