1

My application allows user to delete files from its GUI. Every time they delete something, I want to show the OS confirmation dialog.

I use SHFileOperationW() to move files and folder to the recycle bin. But if the option "Display delete confirmation dialog" is not checked, no dialog will be shown.

Is there a way to programmatically turn on the "Display delete confirmation dialog" on Windows7 and 8?

enter image description here

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
  • Microsoft is making it difficult for developers to do things if the user (the owner of the system) chooses differently. – Sam Hobbs May 03 '16 at 03:33
  • Why? the user specifically asked to NOT see the delete confirmation dialog? Is your intent to annoy? – Chris Becke May 03 '16 at 05:49
  • @ChrisBecke On Windows 7, if user deletes something on a non-local drive (network shared storage, usb drive ...), that item will be deleted permanently. If that option is not checked, there will be no warning dialog. A lot of users don't even know that this option exists under the Recycle bin property. So my application needs to add a protection against accidental deletion. – Dustin Wind May 03 '16 at 14:51
  • Seems like you could [use a CMD command in C++](https://stackoverflow.com/questions/31201631/execute-cmd-commands-using-c) to open the dialog and then [use SendMessage from the Windows API to simulate a button click](https://stackoverflow.com/questions/16295677/how-can-i-simulate-a-button-click-given-the-handle-to-the-buttons-window) – DecimalTurn Aug 21 '19 at 06:55
  • This may help: https://www.partitionwizard.com/disk-recovery/win10-confirm-delete.html – Marco Eckstein Sep 15 '22 at 21:24

0 Answers0