OnPreQueryMultipleValueKey event/delegate/callback


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

CBFSRegistry     See also    


This callback is called before the request for key value data is processed by the system code which deals with the registry.


    property OnPreQueryMultipleValueKey : TCbRegPreQueryMultipleValueKeyEvent;
    TCbRegPreQueryMultipleValueKeyEvent = procedure( Sender : TObject; UserContext: pointer; EntryCount: LongWord; RequestRequiredLength: boolean; ValueNames: TStringList; ValueData: TCbRegInformation; var CallPostCallback : boolean; var StopFiltering : boolean ) of object;

[C++ (Lib)]
    typedef void (*CbRegPreQueryMultipleValueKeyEvent)( CBFSRegistry* Sender, LPVOID UserContext, DWORD EntryCount, bool RequestRequiredLength, PWCHAR ValueNames[], CbRegInformation *ValueData, BOOL * CallPostCallback, BOOL * StopFiltering );

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbRegPreQueryMultipleValueKeyEvent)( System::TObject* Sender, void *UserContext, unsigned EntryCount, bool RequestRequiredLength, TStringList *ValueNames, TCbRegInformation *ValueData, bool &CallPostCallback, bool &StopFiltering );

[C++ (.NET)]
    public delegate void CbRegPreQueryMultipleValueKeyEvent( CBFSRegistry^ Sender, Object^ UserContext, UInt32 EntryCount, bool RequestRequiredLength, array<String^>^ ValueNames, CbRegInformation^ ValueData, bool %CallPostCallback, bool %StopFiltering );

    delegate void CbRegPreQueryMultipleValueKeyEvent( CBFSRegistry Sender, Object UserContext, UInt32 EntryCount, bool RequestRequiredLength, String[] ValueNames, CbRegInformation ValueData, ref bool CallPostCallback, ref bool StopFiltering );

    Delegate Sub CbRegPreQueryMultipleValueKeyEvent( ByVal Sender As CBFSRegistry, ByVal UserContext As Object, ByVal EntryCount As UInt32, ByVal RequestRequiredLength As Boolean, ByVal ValueNames As String(), ByVal ValueData 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
  • EntryCount - the number of values for which data is requested
  • RequestRequiredLength - defines, what value to put to RawDataLength in case when the buffer in ValueData is not enough to hold the data.
    When this happens, ECBFSRegistryError exception with ERROR_MORE_DATA error code must be thrown.
    If RequestRequiredLength is true then RawDataLength must contain total data length for all requested values.
    If the parameter is false, then RawDataLength must contain only the size of full data for entries that have been placed to the RawData buffer.
  • ValueNames - the list of the names of the values to query
  • ValueData - the object that contains information being returned to the system.
    CbRegInformation.RawData points to array of CBREG_MULTIPLE_VALUE_ENTRY structures followed by space to hold data for the values.
    RawDataBufferLength is guarantied to be equal or more than EntryCount * sizeof(CBREG_MULTIPLE_VALUE_ENTRY).
    ValueData.ToObject returns an array of CbRegMultipleValueEntry class instances.
    In case RawDataBufferLength has less space than required, an event handler should fill it with only full data for some entries. Don't put partial entry data to ValueBuffer.
  • 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 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


This callback/event is called before the request for key value data 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

OnPostQueryMultipleKey     OnPreCreateKey     OnPreOpenKey