Alerting the user when an open file has been changed by another application

Like Visual Studio this demo-application alarms the user if any changes made in a file,
wich is open in a document in this time.

Everytime, when a document was opened, or saved as.. the document-class starts a
thread. In this thread, changes will detected in the current directory with a
FinfFirstChangeNotification()-Event. If this event is signaled by the system the
last-write-time of the actual file will be compared. If the comparison failed, the alarm
will start.

If the main window isn’t at the top, the icon in the taskbar will flash until the user
activate the app.

To test the demo, open a textfile, open the same textfile with notepad. When you save
the notepad text, then the alarming will become apparent.

Another test is renaming an open textfile with the windows explorer.

Download demo project – 47 KB

Date Last Updated: April 24, 1999

More by Author

Must Read