0

I thought I knew this but I don't.

Currently I use RegCreateKeyEx to create a key, and then I call RegSetValueEx.

Now what happens is that I create another key (folder in the regedit GUI), and I set the default value for that key (folder).

But how do I add a simple string value (not a sub folder) to that key?

Very roughly I do

RegCreateKeyEx (hKey,
                pszSubKey,
                0,    // ulOptions, must be 0
                NULL, // address of class string
                REG_OPTION_NON_VOLATILE, // special options flag
                KEY_ALL_ACCESS,        // desired security access
                NULL, // address of key security structure
                &hSubKey,          // address of buffer for opened 
                &ActionDone) ;

(void)RegCloseKey(hKey);

RegSetValueEx (hSubKey,
               L"", 
               0,  // reserved
               REG_SZ,
               (const BYTE*)pszData,  // address of value data
               ikByteCount);

...hope its clear....


Owen F. Ransen
Easy to use graphics effects:
http://www.ransen.com/

2
Contributors
1
Reply
5
Views
5 Years
Discussion Span
Last Post by mcriscolo
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.