OnPostCreateKey event/delegate/callback


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

CBFSRegistry     See also    


This callback is called after key creation request has been processed by the system code which deals with the registry.


    property OnPostCreateKey : TCbRegPostCreateKeyEvent;
    TCbRegPostCreateKeyEvent = procedure( Sender : TObject; UserContext: pointer; Result: LongWord; var KeyHandle: THandle; var KeyHandleContext: pointer; var GrantedAccess: ACCESS_MASK; var StopFiltering : boolean ) of object;

[C++ (Lib)]
    typedef void (*CbRegPostCreateKeyEvent)( CBFSRegistry* Sender, LPVOID UserContext, DWORD Result, HANDLE *KeyHandle, LPVOID *KeyHandleContext, DWORD *GrantedAccess, BOOL * StopFiltering );

[C++ (VCL)]
    typedef void __fastcall (__closure *TCbRegPostCreateKeyEvent)( System::TObject* Sender, void *UserContext, unsigned Result, unsigned &KeyHandle, void* &KeyHandleContext, unsigned &GrantedAccess, bool &StopFiltering );

[C++ (.NET)]
    public delegate void CbRegPostCreateKeyEvent( CBFSRegistry^ Sender, Object^ UserContext, UInt32 Result, SafeHandle^ %KeyHandle, Object^ %KeyHandleContext, UInt32 %GrantedAccess, bool %StopFiltering );

    delegate void CbRegPostCreateKeyEvent( CBFSRegistry Sender, Object UserContext, UInt32 Result, ref SafeHandle KeyHandle, ref Object KeyHandleContext, ref UInt32 GrantedAccess, ref bool StopFiltering );

    Delegate Sub CbRegPostCreateKeyEvent( ByVal Sender As CBFSRegistry, ByVal UserContext As Object, ByVal Result As UInt32, ByRef KeyHandle As SafeHandle, ByRef KeyHandleContext As Object, ByRef GrantedAccess As UInt32, ByRef StopFiltering As Boolean )


  • Sender - reference to the class that called the delegate/event handler
  • UserContext - the placeholder for the application-defined data
  • Result - win32 error value of the operation. This value is returned to the originator of the request in the case no other result is returned from the callback.
  • KeyHandle - handle of the key which the application may open instead of the system-opened key (see Description for details)
  • KeyHandleContext - the placeholder for the application-defined data which will be passed to OnCloseHandle event
  • GrantedAccess - if the KeyHandle parameter is used the granted access rights must be set here
  • StopFiltering - If StopFiltering is set to true, no other callbacks for the created key handle will be called


This callback/event is called after the application's request to create a key 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 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

OnCloseKeyHandle     OnPostCloseKey     OnPostOpenKey     OnPreCreateKey