|
-
Mar 7th, 2007, 03:12 PM
#1
Re: Save to registry, but it doesn't!
Nearly . RegCreateKeyEx has a double purpose. If the subkey already exists, it opens it. Whether the key pre-exists or not, it returns a handle to it. The branch to the subkey is created automatically.
Typically, to create a value, irrespective of whether you know it already exists, you'd do: RegCreateKeyEx > RegOpenKeyEx > RegSetValueEx > RegCloseKey.
To read a value, irrespective of whether you know it already exists, you'd do: RegOpenKeyEx > RegQueryValueEx (to get the type of data) > RegQueryValueEx (to get the actual data) > RegCloseKey. And return a default value or error code if RegOpenKeyEx or the first RegQueryValueEx failed.
If you're feeling lazy , search my previous posts using the above function names as keywords.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|