OnRenameOrMoveFileC event/delegate/callback

Filter:

Pascal    C++ (Lib)    C++ (VCL)    C++ (.NET)    C#    VB.NET   

CBFSFilter     See also    

Overview

This callback is called when the OS needs to rename or move the file within a file system.

Declaration

[Pascal]
    property OnRenameOrMoveFileC : TCBFSFltRenameOrMoveFileEventC;
    TCBFSFltRenameOrMoveFileEventC = procedure(Sender : TObject; FileName: TCBString; NewFileName: TCBString; ReplaceIfExists : boolean; var FileContext: pointer; var HandleContext: pointer; var ProcessRequest: boolean) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CBFSFltRenameOrMoveFileEventC)(CBFSFilter* Sender, LPWSTR FileName, LPCWSTR NewFileName, BOOL ReplaceIfExists, PVOID* FileContext, PVOID* HandleContext, LPBOOL ProcessRequest);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCBFSFltRenameOrMoveFileEventC)(System::TObject* Sender, TCBString FileName, TCBString NewFileName, bool ReplaceIfExists, void* &FileContext, void* &HandleContext, bool &ProcessRequest);

[C++ (.NET)]
    public delegate void CBFSFltRenameOrMoveFileEventC(CBFSFilter^ Sender, String^ FileName, String^ NewFileName, bool ReplaceIfExists, IntPtr% FileContext, IntPtr% HandleContext, bool% ProcessRequest);

[C#]
    delegate void CBFSFltRenameOrMoveFileEventC(CBFSFilter Sender, string FileName, string NewFileName, bool ReplaceIfExists, ref IntPtr FileContext, ref IntPtr HandleContext, ref bool ProcessRequest);

[VB.NET]
    Delegate Sub CBFSFltRenameOrMoveFileEventC(ByVal Sender As CBFSFilter, ByVal FileName As String, ByVal NewFileName As String, ByVal ReplaceIfExists As Boolean, ByRef FileContext As IntPtr, ByRef HandleContext As IntPtr, ByRef ProcessRequest As Boolean)

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • FileName - old name of the file
  • NewFileName - new name of the file
  • ReplaceIfExists - specifies whether existing file should be replaced
  • FileContext - the placeholder for the application-defined data, common to all concurrent file operations on the file
  • HandleContext - the placeholder for the application-defined data, local to each opened file handle
  • ProcessRequest - specifies, whether the request must be passed further to the underlying filters and the file system

Description

This callback is called when the OS needs to rename or move the file within a file system.

Error handling

See Error handling topic for detailed information about how to report errors, which occur in the event handlers, back to CBFSFilter.

See also

OnPostRenameOrMoveFileC     OnRenameOrMoveFileN