CallbackRegistry

Control registry operations in Windows and .NET applications

OnPreDeleteValueKey event/delegate/callback

Filter:

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

CallbackRegistry     See also    

Overview

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

Declaration

[Pascal]
    property OnPreDeleteValueKey : TCbRegPreDeleteValueKeyEvent;
    TCbRegPreDeleteValueKeyEvent = procedure( Sender : TObject; UserContext: pointer; ValueName : TCBString; var Processed: boolean; var CallPostCallback: boolean; var StopFiltering : boolean ) of object;
    type TCBString = {$ifdef UNICODE}UnicodeString{$else}WideString{$endif};

[C++ (Lib)]
    typedef void (*CbRegPreDeleteValueKeyEvent)( CallbackRegistry* Sender, LPVOID UserContext, LPCWSTR ValueName, BOOL * Processed, BOOL * CallPostCallback, BOOL * StopFiltering );

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbRegPreDeleteValueKeyEvent)( System::TObject* Sender, void *UserContext, TCBString ValueName, bool &Processed, bool &CallPostCallback, bool &StopFiltering );
    #ifdef UNICODE
    typedef UnicodeString TCBString;
    #else
    typedef WideString TCBString;
    #endif

[C++ (.NET)]
    public delegate void CbRegPreDeleteValueKeyEvent( CallbackRegistry^ Sender, Object^ UserContext, String^ ValueName, bool %Processed, bool %CallPostCallback, bool %StopFiltering );

[C#]
    delegate void CbRegPreDeleteValueKeyEvent( CallbackRegistry Sender, Object UserContext, string ValueName, ref bool Processed, ref bool CallPostCallback, ref bool StopFiltering );

[VB.NET]
    Delegate Sub CbRegPreDeleteValueKeyEvent( ByVal Sender As CallbackRegistry, ByVal UserContext As Object, ByVal ValueName As String, ByRef Processed As Boolean, ByRef CallPostCallback As Boolean, ByRef StopFiltering As Boolean )

Parameters

  • Sender - reference to the class that called the delegate/event handler
  • UserContext - the placeholder for the application-defined data
  • ValueName - the name of the value which is deleted
  • Processed - can be specified that the callback completely processed the request. It matters only if "success" is returned. If this parameter is set then the post-processing callback will not be called. By default it's set to FALSE.
  • 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 - setting it to TRUE stops calling any other callbacks for this key handle. By default it's set to FALSE. Stop filtering can be returned not depending whether error is returned or not.

Description

This callback/event is called before the application's request to delete a value within 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.

You can pass the name of the value to OnPostDeleteValueKey by storing ValueName in the UserContext object.
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 CallbackRegistry.

See also

OnPostDeleteValueKey    

Back to top