Thread: monitoring user actions

  1. #1
    Kiss the monkey. CodeMonkey's Avatar
    Join Date
    Sep 2001

    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++.
    "If you tell the truth, you don't have to remember anything"
    -Mark Twain

  2. #2
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    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.
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ

  3. #3
    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..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 04-03-2008, 09:07 PM
  2. Add/Delete Remotely a user
    By Scarvenger in forum Windows Programming
    Replies: 5
    Last Post: 03-24-2008, 08:36 AM
  3. Replies: 4
    Last Post: 04-21-2004, 04:18 PM
  4. ~ User Input script help~
    By indy in forum C Programming
    Replies: 4
    Last Post: 12-02-2003, 06:01 AM
  5. Stopping a user from typeing.
    By knave in forum C++ Programming
    Replies: 4
    Last Post: 09-10-2001, 12:21 PM