Solved

Detect exactly which file/folder changed when monitoring folder

Posted on 2002-07-02
6
266 Views
Last Modified: 2008-02-01
Hi:

I'm using VB6 and I'm using the FindFirstChangeNotification along with the other ChangeNotification API's and the WaitForSingleObject API to detect when a specified folder's contents have changed.  For example, the program will alert me if someone adds a file, deletes a file, modifies a file in that folder, etc.  I can detect that something changed but I have been unable to figure out exactly what changed.  For example, if someone deletes a file, then I can only detect that the folder in which the file resided has in some way changed.  I'd like to be able to log exactly what was deleted, added, etc.

Looking forward to your responses.

Thank you.
0
Comment
Question by:ksm
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7126516
Can you move to VB.Net and use the FileSystemWatcher?
0
 

Author Comment

by:ksm
ID: 7126561
Interesting.  I have it installed onto my machine but haven't had the chance to start using vb.net yet.  Perhaps now's my reason.
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 7126655
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 28

Expert Comment

by:Ark
ID: 7139588
Hi
You have to use subclassing technique instead of WaitForSingleObject and convert pointers(pidls) from callback function into display names. See this sample for more info:
http://www.mvps.org/vbnet/code/shell/shchangenotify.htm

Cheers
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7348066
This question appears to be abandoned. A question regarding it will be left in the CleanUp
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7373293
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Updates not working for MS Windows 7 12 181
passing a value with stream reader AFTER a ";" 3 74
Help me. 3 60
vbModal 12 57
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

861 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