I know there's a way to monitor a specific folder. I just forget the function name. Any help?
Printable View
I know there's a way to monitor a specific folder. I just forget the function name. Any help?
I don't know if this is what you're looking for?
From MSWDN
Quote:
Monitor Sampling Functions
The monitor sampling functions are high-level functions called by the gateway. These functions internally record simple snapshot statistics and call the Folder Snapshot Functions and the Jump Window Functions to calculate the additional statistics. The monitor maintains a separate thread function, SharedMemoryUpdate, to periodically update the memory-mapped file with the calculated statistics.
The sample gateway uses monitor sample functions to make calls to MONITOR.LIB, which in turn uses the folder snapshot functions and the jump window functions in STATS.LIB. At regular intervals the SharedMemoryUpdate function copies the calculated statistics to the memory-mapped file.
The monitor sampling functions are listed in the following table.
Function Action When called
HrMonInit Initializes the data collection for all statistics of a folder. As gateway starts.
HrMonCollectNDRStats Builds statistics on the number of nondelivery reports produced in a folder. For each nondelivery report sent or received.
HrMonCollectMessage
XferStats Builds statistics on the number of messages traveling in each direction through the gateway. For each message transferred through the gateway.
HrMonCollect
AssociationStats Updates the statistic on the current number of gateway associations. Each time the number of associations changes.
HrMonLockCounters Locks the counters against access by other threads or processes. Before accessing a user-defined counter.
HrMonUnlock
Counters Unlocks the counters to allow access by other threads or processes. After accessing a user-defined counter.
HrMonUninit Closes down the data collection for all statistics. As gateway stops.
Incorrect. This is actually what golfinguy4 means:
Quote:
An application can monitor the contents of a directory and its subdirectories by using the FindFirstChangeNotification, FindNextChangeNotification, and FindCloseChangeNotification
functions. Waiting for a change notification [using the WaitForSingleObject function] is similar to having a read operation pending against a directory and, if necessary, its subdirectories. When something changes within the directory being watched, the read operation is completed. For example, an application can use these functions to update a directory listing whenever a filename within the monitored directory changes.
An application can specify a set of conditions that trigger a change notification by using the FindFirstChangeNotification function. The conditions include changes to filenames, directory names, attributes, file size, time of last write, and security. This function also returns a handle that can be waited on by using the wait functions. If the wait condition is satisfied, FindNextChangeNotification can be used to provide a notification handle to wait on subsequent changes.
The FindCloseChangeNotification function closes the notification handle.
Thanx. That's exactly it poccil.