How can I select a file in Explorer after creating it in a ContextMenu
shell extension?
I created the file using the IFileOperation
API, and tried to use IShellView::SelectItem()
in the IFileProgressSink::FinishOperations()
callback. But the file selection is only flashed briefly before it is unselected again. I assume Explorer notices some changes to files and updates the view.
I can semi-reliably(?) await 10ms after FinishOperations
and then call IShellView::SelectItem
to get it working, but is there a more sensible way to select files after file operations?