Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP6 GETDIR() dialog to show unmapped network drives
Message
 
À
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:
00941307
Vues:
26
Hi Cetin

Thank you. Here is the _GetDir creation with your help. I have confirmed (atleast on my machine W2K) that if I pass an empty string to tcDirectory parameters, I get only local machine and network neighbourhood is not shown, thus the IF condition:
FUNCTION _GetDir(tcDirectory, tcCaption)
        #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)


        *Get directory
        *        oFolder = oShell.BrowseForFolder(0, "Please Select folder", 0)
        *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')

        oShell = CREATEOBJECT("Shell.Application")

        IF EMPTY(tcDirectory)
                oFolder = oShell.BrowseForFolder(0, tcCaption, BIF_RETURNONLYFSDIRS)
        ELSE
                oFolder = oShell.BrowseForFolder(0, tcCaption, BIF_RETURNONLYFSDIRS, tcDirectory)
        ENDIF


        RETURN IIF(TYPE('oFolder.Items.Item') = 'O', oFolder.Items.ITEM.PATH, '')
ENDFUNC
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform