Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 GETDIR() dialog to show unmapped network drives
Message
De
11/09/2004 07:33:02
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00941280
Message ID:
00941295
Vues:
58
This message has been marked as a message which has helped to the initial question of the thread.
To drop control panel,recyle.. add BIF_RETURNONLYFSDIRS (1). Parameter flags are addable. ie:
BIF_BROWSEINCLUDEFILES + BIF_RETURNONLYFSDIRS to only return physical locations and show files.
Here are a list of parameters from shlobj.h (some apply to shell v5 and above):
#define BIF_RETURNONLYFSDIRS   0x0001  // For finding a folder to start document searching
#define BIF_DONTGOBELOWDOMAIN  0x0002  // For starting the Find Computer
#define BIF_STATUSTEXT         0x0004   // Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if
                                        // this flag is set.  Passing the message BFFM_SETSTATUSTEXTA to the hwnd can set the
                                        // rest of the text.  This is not used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets
                                        // all three lines of text.
#define BIF_RETURNFSANCESTORS  0x0008
#define BIF_EDITBOX            0x0010   // Add an editbox to the dialog
#define BIF_VALIDATE           0x0020   // insist on valid result (or CANCEL)

#define BIF_NEWDIALOGSTYLE     0x0040   // Use the new dialog layout with the ability to resize
                                        // Caller needs to call OleInitialize() before using this API

#define BIF_USENEWUI           (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)

#define BIF_BROWSEINCLUDEURLS  0x0080   // Allow URLs to be displayed or entered. (Requires BIF_USENEWUI)
#define BIF_UAHINT             0x0100   // Add a UA hint to the dialog, in place of the edit box. May not be combined with BIF_EDITBOX
#define BIF_NONEWFOLDERBUTTON  0x0200   // Do not add the "New Folder" button to the dialog.  Only applicable with BIF_NEWDIALOGSTYLE.
#define BIF_NOTRANSLATETARGETS 0x0400   // don't traverse target as shortcut

#define BIF_BROWSEFORCOMPUTER  0x1000  // Browsing for Computers.
#define BIF_BROWSEFORPRINTER   0x2000  // Browsing for Printers
#define BIF_BROWSEINCLUDEFILES 0x4000  // Browsing for Everything
#define BIF_SHAREABLE          0x8000  // sharable resources displayed (remote shares, requires BIF_USENEWUI)
oFolder = oShell.BrowseForFolder(0, "Please Select folder", 1)
Would do what you want I think ('' doesn't stop network selection on my test).
Cetin

>Hi Cetin
>
>Many thanks. This is great code. One thing I noticed is that the network path stops showing when an empty string is passed to start folder like below:
>>*oFolder = oShell.BrowseForFolder(0, "Please Select folder", 0,'')
>
>Also can we stop users from selecting say the Recycle Bin. I just want valid directories on the local machine or on the network. I tried changing the 4th para after studying the help (Sorry, I didn't know about BrowseForFolder() function before) but was not very successful, I still could select the control panel printers <g>.
>
>>
>>* Get directory
>>* Get directory specifying \\server\share as root
>>*oFolder = oShell.BrowseForFolder(0, "Please Select folder", 0,'\\server\share')
>>* Get directory or file
>>*oFolder = oShell.BrowseForFolder(0, "Please Select folder or file", BIF_BROWSEINCLUDEFILES)
>>* Get directory or file specifying \\server\share as root
>>*oFolder = oShell.BrowseForFolder(0, "Please Select folder or file", ;
>>* BIF_BROWSEINCLUDEFILES,'\\server\share')
>>
>>#define BIF_BROWSEFORCOMPUTER  0x1000
>>#define BIF_BROWSEFORPRINTER   0x2000
>>#define BIF_BROWSEINCLUDEFILES 0x4000
>>oShell = createobject("Shell.Application")
>>oFolder = oShell.BrowseForFolder(0, "Please Select folder", 0 )
>>RETURN IIF( type('oFolder.Items.Item')='O', oFolder.Items.Item.Path, '')
>>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform