monitoring user actions
Say I wanted to create a program that prompts for a password (or does any other thing) when a user tries to open a certain file from the shell. How would you have a program monitor for that? I'm not asking for any code, just a "how-could-that-be-done". C++.
The file could be a dummy, just a small data file named something like "filename.ext.locked". Your program will be called with the filename specified in the command line, and you will refer to a database to check the user's input against the proper password. A shell extension would be more elegant, but this is an easy alternative. So, here is what would be involved:
1. Edit HKEY_CLASSES_ROOT so that the extension ".locked" calls your program with the filename in the command line.
2. There will be a (hopefully) encrypted database file where your program is that has a list of all your locked files and their passwords.
3. The files themselves can be stored in either another, discreet folder, or compressed/encrypted for better security.
4. The program simply asks for a password, then checks the database. If it is correct, the file is placed back at its location and run.
That's a pretty cool way of doing it. I think I'll have a go at that for fun.
[edit:] Ooh, another aussie on the board.. :D