Boehmi
Boehmi

Reputation: 981

How do I restrict users to only being able to choose certain drives?

Is there any standard way in C++ to limit a user to only select certain drives in an OpenFileDialog?

I've got a function that checks drives if they're flash drives, and only those are supposed to be selectable by the user. The Dialog does have a filter, but all I've seen it used with are file endings, and I'm not sure how I'd go about to limiting drives. Is there any possible way or will I have to restrict this myself in the program?

Upvotes: 0

Views: 81

Answers (1)

MSalters
MSalters

Reputation: 180235

You can reject attempts to change to certain drives via IFileDialogEvents::OnFolderChanging, but that's about it. See IFileDialog

Upvotes: 1

Related Questions