If you wish to poll for changes, you can use GetFileTime(). You will know the file has changed when the lpLastWriteTime value changes.
If you wish to be notified of changes, you can use FindFirstChangeNotification with FILE_NOTIFY_CHANGE_LAST_WRITE. This will be triggered if a change is made to any file in the monitored directory. You then use GetFileTime() to check if it is your file that has changed. You could use something like the following pseudo-code in a seperate thread:
Code:
void MonitorForChanges(LPCTSTR szFile)
{
HANDLE hChange = FindFirstChangeNotification(PathOfFile(szFile), FALSE, FILE_NOTIFY_CHANGE_LAST_WRITE);
while (TRUE)
{
WaitForSingleObject(hChange, INFINITE);
GetFileTime(hFile, &ft1, &ft2, &ftWrite);
if (CompateFileTime(&ftWrite, &ftOriginal) != 0)
{
// Your file has changed. Reload
}
FindNextChangeNotification(hChange);
}
}
Once you have detected a change, you can update your text box using SetWindowText().