Using Win32 functions in Visual FoxPro Image Gallery
File Management
..msdn
CopyFile
CopyFileTransacted
CreateDirectory
CreateFile
CreateFileTransacted
CreateHardLink
CreateSymbolicLink
DeleteFile
DeleteFileTransacted
FindClose
FindCloseChangeNotification
FindFirstChangeNotification
FindFirstFile
FindNextChangeNotification
FindNextFile
FlushFileBuffers
GetBinaryType
GetCurrentDirectory
GetDriveType
GetFileAttributes
GetFileAttributesEx
GetFileInformationByHandle
GetFileType
GetFullPathName
GetLongPathName
GetShortPathName
GetTempFileName
GetTempPath
LockFile
MoveFile
MoveFileTransacted
OpenFile
QueryDosDevice
ReadDirectoryChangesW
ReadFile
RemoveDirectory
RemoveDirectoryTransacted
ReplaceFile
SearchPath
SetCurrentDirectory
SetEndOfFile
SetFileAttributes
SetFilePointer
SetFilePointerEx
SetSearchPathMode
UnlockFile
WriteFile
_lclose
_lopen
Code examples:
Monitoring changes occurring within a directory
ReadDirectoryChangesW
..msdn    Add comment     W32 Constants      Translate this page
The ReadDirectoryChangesW function retrieves information describing the changes occurring within a directory.
Code examples:
Monitoring changes occurring within a directory
Declaration:
BOOL ReadDirectoryChangesW(
  HANDLE hDirectory,
  LPVOID lpBuffer,
  DWORD nBufferLength,
  BOOL bWatchSubtree,
  DWORD dwNotifyFilter,
  LPDWORD lpBytesReturned,
  LPOVERLAPPED lpOverlapped,
  LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
FoxPro declaration:
DECLARE INTEGER ReadDirectoryChangesW IN kernel32;
    INTEGER   hDirectory,;
    STRING  @ lpBuffer,;
    INTEGER   nBufferLength,;
    INTEGER   bWatchSubtree,;
    INTEGER   dwNotifyFilter,;
    INTEGER @ lpBytesReturned,;
    INTEGER   lpOverlapped,;
    INTEGER   lpCompletionRoutine

Parameters:
hDirectory
[in] Handle to the directory to be monitored. This directory must be opened with the FILE_LIST_DIRECTORY access right.

lpBuffer
[in, out] Pointer to the formatted buffer in which the read results are to be returned.

nBufferLength
[in] Length of the buffer pointed to by the lpBuffer parameter, in bytes.

bWatchSubtree
[in] If this parameter is TRUE, the function monitors the directory tree rooted at the specified directory.

dwNotifyFilter
[in] Filter criteria the function checks to determine if the wait operation has completed.

lpBytesReturned
[out] For synchronous calls, this parameter receives the number of bytes transferred into the lpBuffer parameter.

lpOverlapped
[in] Pointer to an OVERLAPPED structure that supplies data to be used during asynchronous operation.

lpCompletionRoutine
[in] Pointer to a completion routine to be called when the operation has been completed or canceled and the calling thread is in an alertable wait state.
Return value:
If the function succeeds, the return value is nonzero. For synchronous calls, this means that the operation succeeded. For asynchronous calls, this indicates that the operation was successfully queued.

If the function fails, the return value is zero. To get extended error information, call GetLastError.
My comment:
Deleting a directory with subdirectories into the Recycle Bin produces a single FILE_NOTIFY_INFORMATION structure with the directory data. While a direct delete (the Recycle Bin is bypassed) triggers ReadDirectoryChangesW for each subdirectory, and finally for the directory.

See also: NetFileEnum, FindFirstChangeNotification
Word Index links for the ReadDirectoryChangesW :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2003-05-09 09:30:06
Modified: 2011-01-30 12:56:59
Visited in last 7 days: 47
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.35), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.197.73.24)
5 sec.Function: 'StrFromTimeInterval'
12 sec.Function: 'SetForegroundWindow'
52 sec.Function: 'UnregisterHotKey'
2.28 min.Function: 'WinHttpOpenRequest'
2.8 min.Function: 'waveInGetPosition'
3.08 min.Function: 'ReleaseCapture'
Google
Advertise here!