Monitoring file access / File opening

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
wpb
Posts: 150
Joined: 14 Dec 2015, 01:53

Monitoring file access / File opening

17 Apr 2016, 03:10

I'm wondering if it's possible to monitor a particular folder to see when files are opened (preferably by the user, but that's not essential). Alternatively, to monitor when files of a particular extension are opened?

I want a callback or event or message or something like that.

The closest I've got so far is SKAN's Shell Change Notification Spy: https://autohotkey.com/board/topic/8413 ... ation-spy/

Using that, I can see links being created and deleted in the recent files shortcut menu, but I feel there must be a better way.

What I'm trying to achieve is a system of tracking changes to particular files. They're basically text files, though they have their own custom extension. I want to be notified when the user opens a file like this so I can read it too and keep a copy of the original contents. Then, when the user saves the file again or hits a hotkey, I will compare the current contents of the file (which I can already successfully read by another method) with the contents of the file as it was when they loaded it.

Hopefully someone with a deeper knowledge than mine of the Windows API will have a bright idea!

Thanks!
SpecialGuest

Re: Monitoring file access / File opening

17 Apr 2016, 09:04

I think someone released a similar script recently... Oh there it is:
JustMe's update of HotKeyIt's WatchDirectory()
https://autohotkey.com/boards/viewtopic.php?f=6&t=8384
wpb
Posts: 150
Joined: 14 Dec 2015, 01:53

Re: Monitoring file access / File opening

20 Apr 2016, 12:49

Thanks for taking the time to reply.

I don't think that solution can notify me of a file load. It could tell me of a file access in theory, although Windows doesn't seem to update the file access date as I would expect.

Are there any other suggestions?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 354 guests