Good evening! I have such a question: imagine such a situation. Suppose you have a folder open using Windows Explorer. There are files in the folder. For example, a program running in the background deletes a file from this folder. And this change is immediately displayed in the explorer - the deleted file disappears in the explorer. So the question is: how is this implemented programmatically? It only comes to mind that when you open the explorer, a certain timer starts to work, with which quite often (say 30 times per second) files are read from the folder and if these files have changed (for example, they have been deleted), the explorer window is redrawn with these changes . But as far as I understand this tracking is very wasteful, vedb needs to be done very often, and not for a single window, but for many other objects. Does anyone have any ideas on this?
2 answers
windows has event queues sent to the window application from where everything is caught, if you need to intercept some kind of event from a third-party application, then a so-called global hook is set up which from the windows queue catches the desired event (well, for example, the keyboard commands sent to explorer)
|
man inotify
. I think in Windows there is a similar event notification mechanism. - avp