Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to registry

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
GB
I want to write a key to the registry. I can do this (using a function I've found that some else wrote that utilizes the API) however I need to be able to give the keys that I create a "(Default)" value.

How would I go about this?

Thanks

elziko
 
elziko,

Use this line of code . . .


lngRetCode = RegSetValueEx(lngKeyHandle, "", 0, REG_SZ, ByVal strReplacementString, lngBufferLength)


You will need a handle to the key that you are writing to (lngKeyHandle). The second parameter is the name of the key that you are writing . . . by using a null string ("") the data is placed in the default value. This line od code uses REG_SZ, o it is writing a string, but you can write any data type here. strReplacementString is the data that will be written into the key and lngBufferLength is the length of the data . . . hope this helps :) - Jeff Marler
(please note, that the page is under construction)
 
elziko -

Check out faq222-92 in this forum. Mike Lacey has put all the API function definitions and constants that you'll need in it.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top