Skip to content

Commit

Permalink
Merge pull request #38 from GiovanniDicanio/add-key_wow64_64key-flag-…
Browse files Browse the repository at this point in the history
…as-default

Added KEY_WOW64_64KEY flag as default access
  • Loading branch information
GiovanniDicanio authored Mar 16, 2021
2 parents 9098566 + 37c9bed commit 9b7ad93
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 95 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2020 by Giovanni Dicanio
Copyright (c) 2017-2021 by Giovanni Dicanio

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WinReg v3.1.0
# WinReg v4.0.0
## High-level C++ Wrapper Around the Low-level Windows Registry C-interface API

by Giovanni Dicanio
Expand Down Expand Up @@ -46,7 +46,31 @@ DWORD dw = key.GetDwordValue (L"SomeDwordValue");
wstring s = key.GetStringValue(L"SomeStringValue");
```
Or you can enumerate all the values under a given key with simple C++ code like this:
You can also open a registry key using a two-step construction process:
```c++
RegKey key{};
key.Open(HKEY_CURRENT_USER, L"SOFTWARE\\SomeKey");
```

The above code will throw an exception on error. If you prefer to check return codes, you can do that as well:

```c++
RegKey key;
RegResult result = key.TryOpen(HKEY_CURRENT_USER, L"SOFTWARE\\SomeKey");
if (! result)
{
//
// Open failed.
//
// You can invoke the RegResult::Code and RegResult::ErrorMessage methods
// for further details.
//
...
}
```

You can also enumerate all the values under a given key with simple C++ code like this:

```c++
auto values = key.EnumValues();
Expand Down
Loading

0 comments on commit 9b7ad93

Please sign in to comment.