Author Topic: write registry  (Read 4293 times)


  • Guest
write registry
« on: April 23, 2008, 09:38:13 PM »
Is there a relatively simple and safe way to write a value to the registry?  Do I need to check for the registry key first and create it if it doesn't exist?


Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: write registry
« Reply #1 on: April 23, 2008, 10:04:55 PM »
See Registry (Windows) at the MSDN.

Proud member of the UltraDefrag Development Team


  • Guest
Re: write registry
« Reply #2 on: June 27, 2008, 09:00:04 PM »
Making some progress :)

I am writing data into registry at expected location.  But the data is not showing as expected, I just see blocks when using PHM Registry Viewer.  Also the compiler seems to require a lot of parameters to be Unicode (I think?).

For example param #2 in the reg create complained until I put the L modifier on it...

Code: [Select]
  HKEY hk;
  char Value[1024];


  //_snwprintf(wchBuf, NELEMS(wchBuf), L"%f", x);
  RegSetValueEx( hk, L"x", 0, REG_SZ, Value, strlen(Value)+1 );



  • Guest
Re: write registry
« Reply #3 on: August 26, 2008, 12:05:02 AM »
I know this is an older thread, but I thought I'd add my 2 cents.

I like to keep all my programs and data on an SD disk, this is because I keep forgetting to recharge the ppc.
If you have had a PPC for very long then most likely you have needed to hit the reset button or left it to the point the backup battery died.
I'm not sure if this this resets the registry but why take the chance ( I don't).
If you use external memory (SD card) then why not write to an ini file in the default program folder?