Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using GETFILE and starting at 'My Documents'
Message
 
 
À
10/04/2008 20:13:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01309856
Message ID:
01309857
Vues:
18
>Hi.
>I'm using GETFILE to open a file but I
>want to select the 'My Documents' folder
>as starting folder.
>I think that I need to change the current
>directory to 'My Documents' using CHDIR
>and then invoke the GETFILE. Question:
>1) How can I change to 'My Documents' if
> the path depends on the user logged-in?
DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ;
   INTEGER hwndOwner, ;
   INTEGER nFolder, ;
   INTEGER hToken, ;
   INTEGER dwFlags, ;
   STRING @ pszPath
lcPath = REPL(CHR(0),261)
= SHGetFolderPath(0,0x28,0,0,@lcPath)
lcMyDocuments = LEFT(lcPath,AT(CHR(0),lcPath)-1)
CD (lcMyDocuments)
lcFile = GETFILE()
>or
>2) Is there another way to do that?

You can use Open File from Windows Common Dialog Controls that have more options. Check Customize the open dialog box in VFP Solutions
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform