Windows Registry

This is a discussion on Windows Registry within the Windows Programming forums, part of the Platform Specific Boards category; I've been reading on working with the registry from the msdn, but there are so many functions, can someone point ...

  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    Windows Registry

    I've been reading on working with the registry from the msdn, but there are so many functions, can someone point me to the fucntions i need for basic work with the registry, creating, up-dating and deleting keys.


    thank you very much.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,266
    The one's you'll be looking for are RegCreateKeyEx for creating keys if they don't exist/opening them if they do, RegQueryValueEx for getting values, RegSetValueEx for setting them and RegDeleteKey for deleting keys. Use RegCloseKey to release handles after use. Note that there is a difference between deleting keys and deleting values.

    I'd love to show you an example but my code CDs are locked up 100 miles away at university. I'm home for Christmas...

  3. #3
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    what is the difference between RegOpenKeyEx and RegCreateKeyEx ?

    i hope i'll make it before you get back to Uni.
    Last edited by Devil Panther; 12-18-2004 at 01:38 PM.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  4. #4
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    RegOpenKeyEx will only open an existing key, whereas RegCreateKeyEx will open an existing or create a new one. You would use RegCreateKeyEx for something that you need to add to the registry. The other is for fetching an existing key.

  5. #5
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768
    but can i use RegCreateKeyEx for both without any worries?
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  6. #6
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Actually, yes. As I said, it will either create it or open it depending on whether or not it already exists.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Network Programming in C for Windows
    By m.mixon in forum C Programming
    Replies: 7
    Last Post: 06-19-2006, 09:27 PM
  2. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 12:14 PM
  3. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 10:37 AM
  4. How come this only works in Windows nt/2000?
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 08-30-2002, 07:54 PM
  5. Windows Registry
    By Nor in forum Windows Programming
    Replies: 1
    Last Post: 02-15-2002, 03:19 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21