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

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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Apr 24, 1999
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

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

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.