Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using GETFILE and starting at 'My Documents'
Message
 
 
To
10/04/2008 20:13:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01309856
Message ID:
01309857
Views:
19
>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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform