broken-e / DragDropConfirm

A simple shell extension for Windows to stop accidental drag and drop moves of folders.
Other
90 stars 25 forks source link

Feature: Disable with CTRL-/X & Default button #4

Closed leoncvlt closed 6 years ago

leoncvlt commented 9 years ago

Hi there, I'd like to request some simple improvements - the ability to disable the window when the copy / move is executed via keyboard rather than drag and drop, and being able to choose the default button as OK instead of Cancel. I am not familiar with the implementation flexibility, are those changes feasible?

bduffek commented 7 years ago

I know this is an old comment but it's still open: The first one I'm personally still trying to research. I'm really new to this kind of thing.

The second is trivial to accomplish, though I don't think it would be good for the main project personally. All it takes is changing MB_DEFBUTTON2 to MB_DEFBUTTON1 in the MessageBoxW call.

bduffek commented 7 years ago

I am double posting since a quick search says edits do not trigger notifications.

I believe adding a registry value to choose which button is default is rather trivial and if I remember I'll look into it. I don't know the proper way to document individual changes for approval though. I am literally brand new to this site and the entire concept of it, I'm a ways off from getting that far anyway, though.

As far as keyboard shortcuts go, I am starting to get the unfortunate feeling it doesn't differentiate between an invisible menu and the normal one when triggered by the user. It also fires when right click dragging, before the user selects an option, which looks to be a challenge (if not impossible) to prevent. Evidence so far suggests even keyboard shortcuts actually invoke the menu and use its corresponding action, but I'm not 100% sure on that.

Edit: I've figured out a very messy way to skip Ctrl-X but it is very sloppy and I wouldn't want to go that direction. The move item location is 0 when moving with the keyboard, but it is 1 when dragging. However if anything else modifies the menus, I have a feeling it could change. It's also possible the location is different on different OS versions or languages.

It also offers nothing in the way of right click moves.

bduffek commented 7 years ago

Okay as the above notification says, adding the option to choose "OK" as the default was trivial.

As I said I spent hours trying to research some way to identify whether the menu is visible or not and thus far I've had no luck. It really bugs me right click drag pops up the confirmation box. Hopefully there is some way. broken-e's knowledge is exponentially greater than mine so it's not a good sign as far as prospects of preventing this side effect.

PeJeyDimO commented 6 years ago

Please make an option for this, I personally like to show the warning dialog all times. :)

bduffek commented 6 years ago

If you have any idea how do share. Unfortunately the only way I figured out how to last year would probably conflict with various shell extensions.

Edit: Actually it does happen all the time. It is stopping it only for the keyboard shortcuts that is more complicated.

bduffek commented 6 years ago

The default option was implemented however I'm not sure, barring a completely different way of this being implemented, that it's possible to tell the difference between keyboard shortcuts and dragging. Because the default button was implemented and the other suggestion seems out of reach I will close this issue.

If anyone knows how differentiating keyboard shortcuts vs. dragging is possible feel free to implement it. I created a new issue only referencing this problem: https://github.com/broken-e/DragDropConfirm/issues/19