Code Monkey home page Code Monkey logo

antishiftdelete's Introduction

AntiShiftDelete

Introduction

AntiShiftDelete is a tiny Shell Extension which can disable the PermanentDelete (Shift+Delete) hot key. Some people (including myself) got used to a habit, that they permanent delete everything instead of recycling to the recycle bin. However, this habit is not that good and might bring us much trouble if we deleted the wrong file/directory. AntiShiftDelete is here to help those who want to get rid of this bad habit! After installing this extension, Windows Explorer will not delete the files when you press Shift+Delete, instead, it will play a beep sound to remind you that you should use normal delete hot key.

Implemention

AntiShiftDelete uses the Microsoft detours library to hook the deletion functions inside the Windows Explorer. So I decided that AntiShiftDelete should be a Shell Extension, as it can be loaded in to explorer.exe automatically.

Shell Extension

There are a variety types of Shell Extensions. But in order that explorer.exe will load my extension as soon as possible, I choose to pretend a IconOverlayHandler (implements IShellIconOverlayIdentifier), which enables the extension to hook explorer.exe in no time.

Hook

Microsoft Detours Library is really easy to use and I'm not going to talk about that. The methods to be hooked are very interesting. In Windows Vista, 7, 8, 8.1, 10 and corresponding Server versions, the explorer.exe does not call Windows APIs directly. Rather, it uses FileOperation COM object to operate files. AntiShiftDelete is able to hook the virtual methods of FileOperation COM object and hold back Permanent Delete.

Compatibility

In theory, Windows Vista and above, both x86 and x64 should be compatible with this extension, but I'm not sure......

Desktop Edition: Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10 Server Edition: Server 2008, Server 2008 R2, Server 2012, Server 2012 R2, Server 2016

antishiftdelete's People

Contributors

jemmy1228 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.