Thread: Reg Methods

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    18

    Reg Methods

    Hi, ive explored the MSDN and i don't quite seem to understand how it explains to write, read or delete reg entries. Could someone provide a simple explanation if at all possible on how to effectively use these methods? I'm mainly interested in HKCU. Thank you.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    It's not that difficult.
    Step 1: Start with RegOpenKeyEx. Pass HKEY_CURRENT_USER as first argument. The second argument is a C-string to the key in the registry you want to open. Third argument should be 0. Fourth argument depends on what you want to do. Typically you want KEY_READ to read something from the registry or KEY_WRITE if you want to write something to the registry. Final argument is a pointer to a HKEY variable, which will contain the information about the opened key.
    Step 2: RegQueryValueEx (read) or RegSetValueEx (write) or RegDeleteKey, RegDeleteTree, RegDeleteValue (all delete).
    Step 3: Close key with RegCloseKey.

    Study the documentation a little more, and look up those functions and should get the hang of it.
    Last edited by Elysia; 05-29-2008 at 12:46 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Check in the Windows forum...

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Oh... registry methods, not regular expression methods.

    *Moved to Windows programming forum*
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Generalising methods to handle multiple weapon types
    By Swarvy in forum Game Programming
    Replies: 2
    Last Post: 05-22-2009, 02:52 AM
  2. Turn Based Stradegy System Methods
    By TylerMoyer in forum Game Programming
    Replies: 2
    Last Post: 07-30-2007, 10:45 PM
  3. Lesson #5 - Methods
    By oval in forum C# Programming
    Replies: 1
    Last Post: 05-04-2006, 03:09 PM
  4. Constructive Feed Back (Java Program)
    By xddxogm3 in forum Tech Board
    Replies: 12
    Last Post: 10-10-2004, 03:41 AM
  5. Replies: 8
    Last Post: 07-27-2003, 01:52 PM