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

OnCloseEnumeration event/delegate/callback


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

CallbackFilter     See also    


This notification callback is called when enumeration of files and subdirectories for given directory is done.


    property OnCloseEnumeration : TCbFltCloseEnumerationEvent;
    TCbFltCloseEnumerationEvent = procedure(Sender : TObject; DirectoryName: TCBString; UserContext: pointer) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbFltCloseEnumerationEvent)(CallbackFilter* Sender, LPCWSTR DirectoryName, PVOID UserContext);

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbFltCloseEnumerationEvent)(System::TObject* Sender, TCBString DirectoryName, void * UserContext);

[C++ (.NET)]
    public delegate void CbFltCloseEnumerationEvent(CallbackFilter^ Sender, String^ DirectoryName, IntPtr UserContext);

    delegate void CbFltCloseEnumerationEvent(CallbackFilter Sender, string DirectoryName, IntPtr UserContext);

    Delegate Sub CbFltCloseEnumerationEvent(ByVal Sender As CallbackFilter, ByVal DirectoryName As String, ByVal UserContext As IntPtr)


  • Sender - reference to the class that called the delegate/event handler
  • DirectoryName - contains the name of the file which is being closed
  • UserContext - the placeholder for the application-defined data


This notification callback is called after file and directory enumeration was finished. The application can release the context and resources, associated with given search.

The application can use UserContext to store the reference to some information, identifying the file or directory (such as file/directory handle or database record ID or reference to the stream class etc). The value, set in the event handler, is later passed to all operations, related to this file, together with file/directory name and attributes. Read more about contexts.

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


Back to top