procedure TCnFileSystemWatcher.Start;
begin
if csDesigning in ComponentState then
Exit;
if Assigned(FOnChange) then
begin
FThread := TCnShellChangeThread.Create(Self,FOnChange);
..............
end;
procedure TCnShellChangeThread.DoIOCompletionEvent;
var
TempBuffer: TNotificationBuffer;
FileOpNotification: PFileNotifyInformation;
Offset: Longint;
FileName1, FileName2: string;
FileOperation: TFileOperation;
procedure DoDirChangeEvent;
var
IsInFileMasks: Boolean;
begin
if Assigned(ChangeEvent) and FActive then
begin
if FTmpFileMasks.Count > 0 then
IsInFileMasks := FileMatchesMasks(FileName1, FTmpFileMasks)
else
IsInFileMasks := FileMatchesMasks(FileName1, '*.*', False);
if IsInFileMasks then
begin
if FIncludePath then
begin
FileName1 := GetTrueFileName(FDirectory + FileName1);
if FileOperation = foRenamed then
FileName2 := GetTrueFileName(FDirectory + FileName2);
end;
ChangeEvent(FParent, FileOperation, FileName1, FileName2);
end;
end;
end;
function GetFileName(const FileName: PWideChar; FileNameLength: DWORD):string;
end;