hey,
i wanna know how to do registry editing.
i was wondering how i could open a key for editing and add a string then close it.
Posted on 2004-02-19 01:41:56 by Brandbub

RegCloseKey
RegConnectRegistry
RegCreateKey
RegCreateKeyEx
RegDeleteKey
RegDeleteValue
RegEnumKey
RegEnumKeyEx
RegEnumValue
RegFlushKey
RegGetKeySecurity
RegLoadKey
RegNotifyChangeKeyValue
RegOpenKey
RegOpenKeyEx
RegQueryInfoKey
RegQueryMultipleValues
RegQueryValue
RegQueryValueEx
RegReplaceKey
RegRestoreKey
RegSaveKey
RegSetKeySecurity
RegSetValue
RegSetValueEx
RegUnLoadKey

:)
Posted on 2004-02-19 08:02:47 by Homer
do you have to do anything special like make a .ini? and if so, what do u put in it.
Posted on 2004-02-19 10:56:42 by njkt809
No, it is the registry, it was designed to replace INI files so there is nothing special you need to do. Here's the breakdown of the write process:

You must first open a key to the section of the registry you want to change:

szRegKey would be a NULL terminated string containing the key name for example:

szRegKey DB "Software\Donkey\SomeApplciation\Options",0


invoke RegOpenKeyEx, HKEY_CURRENT_USER, ADDR szRegKey, 0, KEY_WRITE, ADDR hRegKey


Depending on the type of data you then write to the key, specifying the value name, you must also specify exactly how many bytes you wish to write, for strings this must include the NULL terminator:

invoke RegSetValueEx,[hRegKey], OFFSET szValueName, 0, REG_DWORD,OFFSET dwValue,4


invoke StrLen,OFFSET szString
inc eax ; include the NULL
invoke RegSetValueEx,[hRegKey], OFFSET szValueName, 0, REG_SZ,OFFSET szString,eax

invoke RegSetValueEx,[hRegKey], OFFSET szValueName, 0, REG_BINARY,OFFSET bArray,[cbArray]
; note cbArray is the number of bytes in the array

szValueName would be something like this:

szValueName DB "MyKey",0


When you are done writing you close the key:

invoke RegCloseKey,

To read the values you just open the key with read access and use RegQueryValueEx to obtain your values.
Posted on 2004-02-19 11:11:13 by donkey
ok thanks, everything works great
Posted on 2004-02-19 11:19:13 by njkt809