I'm looking for a programmatic way to prompt the user for filenames using the explorer shell and I only want system shell extensions loaded.
The reason I'm looking for this feature is that I want to eliminate 3rd party shell extension as a possible cause for crashes and other nondeterministic behavior.
Ideally, there's a flag somewhere that I missed that I can pass in to a function that means something like a "safe mode" for an explorer instance where it only loads the system shell extensions. This seems like such an essential feature and I've spent a good amount of time poring over docs to find it to no avail.
I've looked through the API docs for CFileDialog, GetOpenFileName and IFileOpenDialog. It looks like the only way to prevent the loading of non system shell extensions is by doing some sort of global hackery via registry twiddling or by using software utilities. Neither of these are satisfactory for well-behaved apps.
I know that I can use the "old style" file dialogs that aren't explorer based, but my users would kill me if I forced that on them. :)
The only way I can think of around this is to (ugh) reinvent the wheel and write an explorer-like file open dialog.
来源:https://stackoverflow.com/questions/10399627/prevent-all-non-system-shell-extensions-from-loading-in-a-getopenfilename-cfile