Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FindFirstChangeNotification

Posted on 1998-08-06
16
Medium Priority
?
819 Views
Last Modified: 2008-02-01
i am using FindFirstChangeNotification / FindNextChangeNotification in a thread and it works fine.
What reports is only that something has changed in the defined directory or below.

I need to know in which subdir. the change was.
How can i use the handle (h) to find details?

path := stralloc(64);
path := 'c:\temp\';
h := FindFirstChangeNotification(path, BOOL(1), FILE_NOTIFY_CHANGE_FILE_NAME OR FILE_NOTIFY_CHANGE_DIR_NAME);
0
Comment
Question by:kyr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
  • +3
16 Comments
 

Expert Comment

by:kashif063098
ID: 1361636
hi
you can use Win32 api GetFileInformationByHandle() to get additional info of directory or file


0
 

Expert Comment

by:kashif063098
ID: 1361637
if you example,please let me know

0
 

Author Comment

by:kyr
ID: 1361638
are you sure?
Does GetFileInformationByHandle work with the handle that
FindFirstChangeNotification returns?

I couldn't make it work...
Actually this handle is a handle to a find change notification object.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 20

Expert Comment

by:Madshi
ID: 1361639
As far as I know, FindFirstChangeNotification is just stupid. You can't get further infos from your handle.  :-(
But I'm not so absolutely sure...
We solved this problem with a vxd driver. You can find a vxd sample "FileMonitor" on "www.sysinternals.com". It's just what you need. But I don't know if you really want to work with drivers. If you want, you'll need the example (see above) and Microsoft or Borland C compiler and vireo's vToolsD.
Sorry!
0
 
LVL 8

Expert Comment

by:Answers2000
ID: 1361640
Use ReadDirectoryChangesW instead

This gives you access to a structure called FILE_NOTIFY_INFORMATION which contains the name of the file and the operation performed.


0
 
LVL 20

Expert Comment

by:Madshi
ID: 1361641
Works only with WinNT, I suppose...  :-(
0
 

Expert Comment

by:JimmyWhite
ID: 1361642
hi,

Look at Torry's Delphi Pages in the section vcl, files and drives or something like that and you will find 3 or 4 components with source which will do exactly what you want.
The best are : dirchange and dirmon.
0
 

Author Comment

by:kyr
ID: 1361643
Answers2000:
It is only for NT sorry... i cannot accept it. I cannot ever give it a try

JimmyWhite:
This is not what i am looking for.
The first one only tells you a change has occured, while the other one only monitors the current level of the giver directory, not its subs.

QUESTION TURNS TO:
what i found best is to try to connect to filevxd.vxf from filemon at www.sysinternals.com, and do the rest.
But i cannot convert the c code to obj.pascal (source code from site above).
I would appreciate any help to do this
(increased points to 150-tell me for more.)

0
 

Author Comment

by:kyr
ID: 1361644
Adjusted points to 150
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1361645
I'm not sure. Do you want to
(1) build the driver itself in Delphi or
(2) use vireo's driver and communicate with it in Delphi?
As far as I know (1) does not work at all. (2) should be possible, but where is your problem? Don't you understand C(++)? If so, I cannot help you, because I don't have the time to do the whole work for you. But if there are only some specific problems, tell me details...

Regards, Madshi.
0
 

Author Comment

by:kyr
ID: 1361647
ronit: they say nothing of great interest.
it is not that you/they cannot help.

i understand i am using the wrong approach.

the sysinternals vxd driver is abslutely the best solution.

Dear Madshi,
  -can i freely use the driver with a project currently developing?
  -i finally managed to connect to it from delphi and it works perfectly.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1361648
kyr,

that's a good question. I don't know that either, because we built our own driver and only looked at the sysinternals sources. Please write to "cogswell@winternals.com". He will answer your question.

Regards, Madshi.
0
 

Author Comment

by:kyr
ID: 1361649
i am giving you the points Madshi!
please propose it as answer.
question is closed.
0
 
LVL 20

Accepted Solution

by:
Madshi earned 600 total points
ID: 1361650
Thanks, kyr...   :-)
0
 

Author Comment

by:kyr
ID: 1361651
thanks too...

cu
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

660 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question