From 41d298abeb1d15a1e751a89d27bb6ebb9fbbdc7a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 8 Jul 2025 00:58:04 +0200 Subject: [PATCH] Add wxRegKey::GetHkey() Provide access to the underlying HKEY, especially as we already allow setting it. --- include/wx/msw/registry.h | 2 ++ interface/wx/msw/registry.h | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/wx/msw/registry.h b/include/wx/msw/registry.h index 2ac61272d3..aae8ed316a 100644 --- a/include/wx/msw/registry.h +++ b/include/wx/msw/registry.h @@ -139,6 +139,8 @@ public: bool IsOpened() const { return m_hKey != nullptr; } // for "if ( !key ) wxLogError(...)" kind of expressions operator bool() const { return m_dwLastError == 0; } + // return the associated HKEY, possibly null if the key is not opened + WXHKEY GetHkey() const { return m_hKey; } // operations on the key itself // explicitly open the key (will be automatically done by all functions diff --git a/interface/wx/msw/registry.h b/interface/wx/msw/registry.h index 2d887d0b8a..1caa6ed42f 100644 --- a/interface/wx/msw/registry.h +++ b/interface/wx/msw/registry.h @@ -236,6 +236,15 @@ public: */ bool GetFirstValue(wxString& strValueName, long& lIndex); + /** + Return the associated HKEY handle. + + It may be null if the key is not opened. + + @since 3.3.1 + */ + WXHKEY GetHkey() const; + /** Gets information about the key. Returns @true if successful.