Home > Back-end >  How to monitor only within the directory specified file operations?
How to monitor only within the directory specified file operations?

Time:10-01

The function SHChangeNotifyRegister (hWnd: hWnd; DwFlags: Integer;
WEventMask: Cardinal; UMsg: UINT; CItems: Integer;
LpItems: PNotifyRegister) : HWND; Stdcall; External Shell32 index 2;
The function SHILCreateFromPath (pszPath: PChar; Ppidl: PItemIDList;
RgflnOut: PDWORD) : HResult; Stdcall; External Shell32 index of 28;

Var
FNotifyHandle: THandle;

Procedure SHChangeRegister (const Handle, uMsg: Cardinal; Const FilePath: string);
Var
VNotifyRegister: NOTIFYREGISTER;
VAttributes: WORD;
VItemIDList: PItemIDList;
The begin
SHILCreatefromPath (PChar (FilePath), @ vItemIDList, @ vAttributes);
VNotifyRegister. PidlPath:=vItemIDList;
VNotifyRegister. BWatchSubtree:=True;

FNotifyHandle:=SHChangeNotifyRegister (Handle, SHCNF_TYPE or SHCNF_IDLIST,
SHCNE_ALLEVENTS or SHCNE_INTERRUPT, uMsg, 1, @ vNotifyRegister);
end;

But although that specifies the filepath can overall monitoring, can achieve is to monitor a directory?
  • Related