OnPostOpenKey event/delegate/callback


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

CBFSRegistry     See also    


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


    property OnPostOpenKey : TCbRegPostOpenKeyEvent;
    TCbRegPostOpenKeyEvent = 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 (*CbRegPostOpenKeyEvent)( CBFSRegistry* Sender, LPVOID UserContext, DWORD Result, HANDLE *KeyHandle, LPVOID *KeyHandleContext, DWORD *GrantedAccess, BOOL * StopFiltering );

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

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

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

    Delegate Sub CbRegPostOpenKeyEvent( 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 open 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 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

OnCloseKeyHandle     OnPostCloseKey     OnPostCreateKey     OnPreOpenKey