Instant control over file and folder operations in Windows and .NET applications

OnRenameOrMoveFileC event/delegate/callback


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

CallbackFilter     See also    


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


    property OnRenameOrMoveFileC : TCbFltRenameOrMoveFileEventC;
    TCbFltRenameOrMoveFileEventC = procedure(Sender : TObject; FileName: TCBString; NewFileName: TCBString; ReplaceIfExists : boolean; var UserContext: pointer; var ProcessRequest: boolean) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltRenameOrMoveFileEventC)(CallbackFilter* Sender, LPWSTR FileName, LPCWSTR NewFileName, BOOL ReplaceIfExists, PVOID* UserContext, LPBOOL ProcessRequest);

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

[C++ (.NET)]
    public delegate void CbFltRenameOrMoveFileEventC(CallbackFilter^ Sender, String^ FileName, String^ NewFileName, bool ReplaceIfExists, IntPtr% UserContext, bool% ProcessRequest);

    delegate void CbFltRenameOrMoveFileEventC(CallbackFilter Sender, string FileName, string NewFileName, bool ReplaceIfExists, ref IntPtr UserContext, ref bool ProcessRequest);

    Delegate Sub CbFltRenameOrMoveFileEventC(ByVal Sender As CallbackFilter, ByVal FileName As String, ByVal NewFileName As String, ByVal ReplaceIfExists As Boolean, ByRef UserContext As IntPtr, ByRef ProcessRequest As Boolean)


  • 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
  • UserContext - the placeholder for the application-defined data
  • ProcessRequest - specifies, whether the request must be passed further to the underlying filters and the file system


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 CallbackFilter.

See also

OnPostRenameOrMoveFileC     OnRenameOrMoveFileN    

Back to top