OnPreCloseKey event/delegate/callback


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

CBFSRegistry     See also    


This callback is called when a thread attempts to close the key.


    property OnPreCloseKey : TCbRegPreCloseKeyEvent;
    TCbRegPreCloseKeyEvent = procedure( Sender : TObject; UserContext: pointer; var StopFiltering : boolean ) of object;

[C++ (Lib)]
    typedef void (*CbRegPreCloseKeyEvent)( CBFSRegistry* Sender, LPVOID UserContext, LPBOOL StopFiltering );

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbRegPreCloseKeyEvent)( System::TObject* Sender, void * UserContext, bool &StopFiltering );

[C++ (.NET)]
    public delegate void CbRegPreCloseKeyEvent( CBFSRegistry^ Sender, Object^ UserContext, bool% StopFiltering );

    delegate void CbRegPreCloseKeyEvent( CBFSRegistry Sender, Object UserContext, ref bool StopFiltering );

    Delegate Sub CbRegPreCloseKeyEvent( ByVal Sender As CBFSRegistry, ByVal UserContext As Object, ByRef StopFiltering As Boolean )


  • Sender - reference to the class that called the delegate/event handler
  • UserContext - the placeholder for the application-defined data
  • StopFiltering - parameter set to true tells the driver to not pass the request to the registry. Parameter set to false allows further processing of the request.


This callback/event handler is called before the application's request to close a key is passed to the registry manager in Windows. The name of the key should be obtained from the user context which must have been set in OnPreCreateKey/OnPreOpenKey callback/event handlers.
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 CBFSRegistry.

See also

OnPostCloseKey     OnPreCreateKey     OnPreOpenKey