Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preventing File Access when calling GetFile()

Status
Not open for further replies.

volfreak

Programmer
Nov 6, 2000
42
0
0
US
All,

When using the GetFile function in VFP, the Windows dialog is presented to allow someone to choose a file. In addition, one can right-click and choose to open/edit any displayed file.

Is there a way to make the GetFile a "Read only" process such that the ONLY thing the user can do is to "Select" a file and not open or edit any listed file?

thanks much in advance for any and all help.
 
volfreak,

Try using ADIR() to put desired files into an array. Then put the array of files into a listbox or combobox.

Good luck,
Steve
 
Thanks spayne,

Appreciate the quick reply. Yeah, I can do that but what I was hoping to do was to not have to 'roll my own' file and directory access module but it sounds like I may have to. I'm part way there with the tree control and populating it but was trying to find something a little easier.

We have users that have access to a few folders as well as a Citrix v: drive (mapped to their local c: drive) and as such, limiting them to one folder won't work and we have to give them the ability to navigate to the other folders (or v: drive). I was hoping there might be something in the Windows API that I could use to prevent someone from opening/editing files when using the file picker.

cheers and happy new year!
 
You can, but you'll need to as you suspect use the API.
( you can roll your own totally in VFP,
but the API is faster and easier in long run )

I don't have a lot of time to describe how to
do it right now, but the following link will
point you in right direction:


Darrell
'We all must do the hard bits so when we get bit we know where to bite' :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top