Board index » delphi » Notify if Directory contents have changed?

Notify if Directory contents have changed?

Hi,

I've created a custom listview to display the contents of a directory
and now I want to be able to dynamically refresh the listview if the
files in the directory change. Much like Windows Explorer when you add a
new file, it usually refresh the contents of the listview. Does anyone
have any suggestions how best to approach this?

TIA,

Robert

 

Re:Notify if Directory contents have changed?


Robert,

you can use the FindFirstChangeNotification API for this.

--
Regards
Ralph (TeamB)
--

Quote
Robert Barr wrote in message <36F8F7C5.C2B7B...@unm.edu>...

|Hi,
|
|I've created a custom listview to display the contents of a directory
|and now I want to be able to dynamically refresh the listview if the
|files in the directory change. Much like Windows Explorer when you add a
|new file, it usually refresh the contents of the listview. Does anyone
|have any suggestions how best to approach this?
|
|TIA,
|
|Robert

Re:Notify if Directory contents have changed?


why not use a TTimer set to 10-15 seconds to refresh the listview? Just
do a LockWindowUpdate call before to eliminate the screen flashing (all
you'll get is the list refreshing).
Wayne
Quote
Robert Barr wrote:

> Hi,

> I've created a custom listview to display the contents of a directory
> and now I want to be able to dynamically refresh the listview if the
> files in the directory change. Much like Windows Explorer when you add a
> new file, it usually refresh the contents of the listview. Does anyone
> have any suggestions how best to approach this?

> TIA,

> Robert

Other Threads