OnPreEnumerateKey event/delegate/callback


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

CBFSRegistry     See also    


This callback is called before the iteration of the key enumeration request has been processed by the system code which deals with the registry.


    property OnPreEnumerateKey : TCbRegPreEnumerateKeyEvent;
    TCbRegPreEnumerateKeyEvent = procedure( Sender : TObject; UserContext: pointer; Index: LongWord; KeyInformationClass: KEY_INFORMATION_CLASS; KeyInformation: TCbRegInformation; var CallPostCallback: boolean; var StopFiltering : boolean ) of object;

[C++ (Lib)]
    typedef void (*CbRegPreEnumerateKeyEvent)( CBFSRegistry* Sender, LPVOID UserContext, DWORD Index, KEY_INFORMATION_CLASS KeyInformationClass, CbRegInformation *KeyInformation, BOOL * CallPostCallback, BOOL * StopFiltering );

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbRegPreEnumerateKeyEvent)( System::TObject* Sender, void *UserContext, unsigned Index, Cbregapi::_KEY_INFORMATION_CLASS KeyInformationClass, TCbRegInformation *KeyInformation, bool &CallPostCallback, bool &StopFiltering );

[C++ (.NET)]
    public delegate void CbRegPreEnumerateKeyEvent( CBFSRegistry^ Sender, Object^ UserContext, UInt32 Result, UInt32 Index, CbReg::KEY_INFORMATION_CLASS KeyInformationClass, CbRegInformation^ KeyInformation, bool %CallPostCallback, bool %StopFiltering );

    delegate void CbRegPreEnumerateKeyEvent( CBFSRegistry Sender, Object UserContext, UInt32 Index, CbReg.KEY_INFORMATION_CLASS KeyInformationClass, CbRegInformation KeyInformation, ref bool CallPostCallback, ref bool StopFiltering );

    Delegate Sub CbRegPreEnumerateKeyEvent( ByVal Sender As CBFSRegistry, ByVal UserContext As Object, ByVal Index As UInt32, ByVal KeyInformationClass As CbReg.KEY_INFORMATION_CLASS, ByVal KeyInformation As CbRegInformation, ByRef CallPostCallback As Boolean, ByRef StopFiltering As Boolean )


  • Sender - reference to the class that called the delegate/event handler
  • UserContext - the placeholder for the application-defined data
  • Index - the zero-based index of the subkey within the key
  • KeyInformationClass - the value that indicates the type of information to be returned by the system in the KeyInformation object
  • KeyInformation - the object that contains information being returned to the system
  • CallPostCallback - if it's set then the post-processing callback will be called. By default it's TRUE. This parameter doesn't matter when StopFiltering or Processed is set or non-successful result is returned.
  • StopFiltering - if StopFiltering is set to true, no other callbacks for the created key handle will be called

Values of KeyInformationClass


This callback/event is called before each iteration of the key enumeration request is processed by the registry manager in Windows. The name of the key should be obtained from the user context which must have been set in OnPreOpenKey/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

OnPostEnumerateKey     OnPreCreateKey     OnPreOpenKey