C++ WinReg Update

The Windows Registry native C API is very low-level and hard to use.

A while back I developed some convenient higher-level C++ wrappers, that should make Windows Registry programming easier and more fun. You can find them on GitHub.

Just to give you a taste of this C++ WinReg library, you can simply open a registry key with code like this:

RegKey key{ HKEY_CURRENT_USER, L"SOFTWARE\\MyKey" };

And you can read registry values like that:

DWORD dw = key.GetDwordValue(L"MagicCode");
wstring s = key.GetStringValue(L"ReadMe");

Enumerating values under a given key is as easy as:

auto values = key.EnumValues();

Error management is performed using C++ exceptions (instead of “raw” error codes like in the native C API).

You can find more info in the README file.

I haven’t touched that project in a few months (being very busy), but yesterday I accepted an external contribution and merged a pull request adding a DeleteTree feature.

I take this occasion to thank everyone who showed interest and appreciation for this project.

Happy coding!

 

Leave a Reply

Your email address will not be published. Required fields are marked *