Notification when a file is open
Posted on 2007-10-19
Well this is a long story. The problem is that some guys at work have started to read the event log of other computers looking for the "Net Send" messages received by other people, you know, that if you go to My Network Places/Entire Network/Directory/Computers, right click on any of the computers listed, select the option Manage, you will see the Computer Management window of the computer selected. Once you are already there you can go System Tools/Event Viewer/System, and you will see the Event Log. After this, it is just a matter of double-clicking on any of the events that have "Application Popup" as source, to see the messages that computer has received.
Having telling the story, what I need is to code a program that detects when someone has open a session in my computer to see the event log. I've noticed that when this happens I can see the session in Computer Management/ System Tools/Shared Folders/Sessions and an entry in Computer Management/ System Tools/Shared Folders/Open Files, this entry shows PIPE\EVENT-LOG as file name. So I suppose that since this is detected as a shared file opened then using the NetFileEnum Api, the PIPE\EVENT-LOG will be listed and I can identify it by the name. However, this will require the program to be a sort of demon that reads the shared files opened periodically, say every, 5 seconds. I do not see much of a problem on that because it is a very light process that will not affect my PC performance at all. However, I'd like to know if there is a way of generating a notification at the moment it happens.
Thanks a lot for any help.