What I find very difficult is to allow a process to know what other content is being accessed by another process.
Yes, that's difficult but it's not the most difficult part. On Windows (I don't do anything other than Windows), there is an API that returns _all_ the handles being used system-wide. With that list of handles, it is possible to determine the file and the program that is using it. The downside of this method is that, the list has to be polled which can consume too much CPU if the polling is too frequent.
What is truly very hard is to determine when the note should be shown because it means the notes program has to "somehow" figure out what the reader is displaying to determine if there is a note associated with the text. I've got a couple of ideas about how to get that done but, I've never tried them in anything else, therefore I don't know if they would work.
Anyway, I was hoping that someone had already done all the hard work (or written a component that does most of it) but, it doesn't look like it has been done and I don't think I can spread myself any thinner.