Hi!
I need function BrowseForFolder.
Grigori Filatov posted such a sample a lot of time ago.
But, I want to ask if can we improve it, by adding possibilities to create new folder.
It's strange, but, if I put this code in another module, searching always start fom desktop and header is taken default.
It looks like a problem with passing parameters to this function
gfilatov wrote:
esgici wrote:Hi all
Does anyone know a way to adding a second parameter for <Initial Folder> to GetFolder() function ?
I do not know if you have already solved about "Make New Folder" option in hb_BrowseForFolder.
But it is very simple. According new source/sample of C:\MiniGUI\SAMPLES\Advanced\BrowseForFolder\demo.prg you can see this "Make New Folder" option can be applied to the nflag parameter adding BIF_NEWDIALOGSTYLE
I do not know if you have already solved about "Make New Folder" option in hb_BrowseForFolder.
But it is very simple. According new source/sample of C:\MiniGUI\SAMPLES\Advanced\BrowseForFolder\demo.prg you can see this "Make New Folder" option can be applied to the nflag parameter adding BIF_NEWDIALOGSTYLE
GetFolder ( [<cTitle>] , [<cInitPath>], [<cInvalidDataMsg>], [<lNewFolderButton>] , [<lIncludeFiles>] , [<nCSIDL_FolderType>] , [<nBIF_Flags>] )--> cSelectedFolderName
- nCSIDL_FolderType (constants defined in i_misc.ch): CSIDL (Constant Special Item ID List) values provide a unique system-independent way to identify special folders used frequently by applications, but which may not have the same name or location on any given system (for default CSIDL_DRIVES).
- nBIF_Flags (constants defined in i_misc.ch):
o BIF_EDITBOX(*): Include an edit control in the browse dialog box that allows the user to type the name of an item.
o BIF_VALIDATE(*): If the user types an invalid name into the edit box, the browse dialog box calls the application's BrowseCallbackProc with the BFFM_VALIDATEFAILED message ( ignored if BIF_EDITBOX is not specified)
o BIF_NEWDIALOGSTYLE(*): Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized. The dialog box has several new capabilities, including: drag-and-drop capability within the dialog box,reordering, shortcut menus, new folders, delete, and other shortcut menu commands.
o BIF_USENEWUI(*): equivalent to BIF_EDITBOX + BIF_NEWDIALOGSTYLE.
(*) set for default.
o BIF_RETURNONLYFSDIRS: Only return file system directories.
o BIF_DONTGOBELOWDOMAIN: Do not include network folders below the domain level in the dialog box's tree view control.
o BIF_STATUSTEXT: Include a status area in the dialog box ( not supported when BIF_NEWDIALOGSTYLE )
o BIF_RETURNFSANCESTORS: Only return file system ancestors. An ancestor is a subfolder that is beneath the root folder in the namespace hierarchy.
o BIF_BROWSEINCLUDEURLS: The browse dialog box can display URLs. The BIF_USENEWUI and BIF_BROWSEINCLUDEFILES flags must also be set.
o BIF_UAHINT: When combined with BIF_NEWDIALOGSTYLE, adds a usage hint to the dialog box, in place of the edit box (BIF_EDITBOX overrides this flag)
o BIF_NONEWFOLDERBUTTON: Do not include the New Folder button in the browse dialog box.
o BIF_NOTRANSLATETARGETS: When the selected item is a shortcut, return the PIDL of the shortcut itself rather than its target.
o BIF_BROWSEFORCOMPUTER: Only return computers
o BIF_BROWSEFORPRINTER: Only allow the selection of printers. In Windows XP and later systems, the best practice is to use a Windows XP-style dialog, setting the root of the dialog to the Printers and Faxes folder (CSIDL_PRINTERS).
o BIF_BROWSEINCLUDEFILES: The browse dialog box displays files as well as folders.
o BIF_SHAREABLE: The browse dialog box can display sharable resources on remote systems. The BIF_NEWDIALOGSTYLE flag must also be set.
o BIF_BROWSEFILEJUNCTIONS: Windows 7 and later. Allow folder junctions such as a library or a compressed file with a .zip file name extension to be browsed.
Pablo César wrote:Thanks Claudio for your additional clarification, very rich doc. This was announced at this topic (see at "Improvement in GetFolder()")
So many options, would be very usefull to elaborate vary examples of all of these ressources.
At least for me, many others ressources was not tested yet... thank you again Claudio !