Click to See Complete Forum and Search --> : Where in registry?


Y0rkieP
July 6th, 2007, 08:24 PM
Hi all,
I program as a hobby and learning on my way. Ive been learning c++, winAPI & simple to moderate GDI.

Ive made several clockfaces as bmp's, which are selectable and used TransparectBlt to draw them. After re-learning some maths, I used Lineto with sin / cos to draw the hands. Also I have chimes that turn on and off.

All this now works fine now, after fixing all the bugs (joy), but the clock dosent remember the last settings used. Ie: set chimes & set face.

Ive looked at RegCreateKeyEx and know I can use this to set / check the values, but there is so many entries. I assume to use HKEY_USERS (all users), but is there a correct place in which to put this entry? Is there any particular format to use or do I just pick a point at random? Are there any guides to look for on registry placement (I found nothing)?

If Ime going to do this, I should do it right from the start, rarther than create more bad habbits that I need to un-learn.

the values written will be:

nFace (1 to 5)
bChime (true/false(>0 or 0))

My thanks to all whom answer for your views...

ovidiucucu
July 6th, 2007, 08:45 PM
Usually, the current user application settings are kept under
HKEY_CURRENT_USER\Software\<company_mame>\<application_name> key.

You can use two REG_DWORD type values, let's say named "Face" and "Chime", to store nFace and bChime, respectively.

Y0rkieP
July 6th, 2007, 09:21 PM
Hi ovidiucucu,

thanky for your help. I had the idea of using DWORD for my values, I was just puzzled to what the usual naming conventons the path may be. Though I dont have a company name, Im sure something can be thought of. Least I now have some format to abide by & that will get me started.

Still, If anyone knows any good online documentation to do with registry and newbies (I know, not a good mix), feel free to add your views. As allways, any help will be appreciated...

thanks again.

ovidiucucu
July 7th, 2007, 06:59 AM
Well, you're free to replace <company_mame> with what your muscles want. ;)
Just you have to provide, as much as possible, a unique key name to avoid mixing with another existing one.

Y0rkieP
July 7th, 2007, 11:32 AM
That is probebly the key... pardon the pun. That the path is completely unique. I have an alias that I use for programming and whilst I had a mad fit during the graphics creation phase, I went and slapped "My Time" all over the clock face - even though I simply called the application "clock". So, I have decided to go with:

HKEY_CURRENT_USER\Software\<alias>Soft\MyTime\Clock\

I suppose the benefit to keeping to that naming convention would be that I can find all the keys for present/future applications in the same place. just change the end of the path.

I'll code it as soon as I have a decent bit of time off work. Work allways seems to get in the way of fun, I notice. hehe...