Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using variables
Message
De
08/10/1998 12:51:21
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00144971
Message ID:
00145105
Vues:
37
>Ed,
>
>Cool function there, thanks for posting it. It does error out if you select Desktop in Win95 OSR2 though.
>

You can avoid it - once oBrowseObject is returned and an object, test to make sure that there is a parent folder items collection - if not, you're pointed at one of the Windows special folders. You can trap it by using the following in place of the FOR EACH loop in the FAQ code:
IF TYPE('oBrowseObject.ParentFolder.Items') # 'U'
    FOR EACH Item IN oBrowseObject.ParentFolder.Items
        IF Item.Name == oBrowseObject.Title
            cPathToReturn = Item.Path
            EXIT
        ENDIF
    ENDFOR
ENDIF
If you do have no ParentFolder.items collection, you can examine the special folders either in the Registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
and look for they registry value named in oBrowseObject.Title, or use the Wscript.Shell automation object's SpecialFolders collection to retrieve the path, finding the item.Name that matches oBrowseObject.Title in the collection (thwis requires that Wscript have been installed and the WSHOM.OCX is registered, meaning 98, NT 4.0 with Option Pack 4, or the NT 5 beta.)

>>Look at the FAQ entry I posted earlier that describes using the Shell automation object to replace the GETDIR() function in VFP.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform