11-20-2015 03:35 AM
For a similar applicatin I made some attempt with some system function that may be of help in this case: FindFirstChangeNotification Win32 API function sets an event when some file in a folder is changed.
I am attaching a simple project that monitors a single file in a folder, receives notifications and if file is changed displays its content on screen. To test the example simply start the program, set the folder and file name and start monitoring: when you write in the file and save it, the program is notified and displays updated content in a textbox. There is no need to close the monitored file: simply save it (unless the file is opened in exclusive mode, in which case you are likely to get I/O errors).
The application works well for local files, while it gets errors while monitoring folders on a remote server and I didn't find a way to solve this.
11-20-2015 03:40 AM
Ah, having an event of course is much nicer!
11-20-2015 07:49 AM
Much thanks, Roberto!
However, a couple compiling issues:
11-20-2015 08:44 AM
I was in a hurry and didn't pay attention to those details. Anyway, neither the icon nor the libraries are needed to run the sample: this one is the reduction of a bigger test program I had that made use of them but I stripped out the relevant instructions. And I forgot to add the config file too...
11-20-2015 08:49 AM
Wolfgang ha scritto:
Ah, having an event of course is much nicer!
I am coming to think that some kind of event does exist in Windows for almost every condition I can think of!
The problems I have are: