CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2012
    Location
    Cochin, India
    Posts
    8

    Question working with Windows Registry

    hi
    I am developing a program that needs auto start at windows startup. For that I need to add Registry entries. Also the program needs to read some registry keys. What are the functions i need to do these.. Simply I need to

    check if the startup key already exists
    add a new key if it doesn't exist
    read a key values

    Somebody please help me. I found a lot of functions in MSDN site. But I didn't find the required functions..

    thanks
    ashik thomas

  2. #2
    Join Date
    Apr 2004
    Location
    In the back seat of New Horizons.
    Posts
    1,238

    Re: working with Windows Registry

    Why would you do that?

    http://www.sevenforums.com/tutorials...ms-change.html

    Go to the part where it says "METHOD TWO". Just put the executable in the StartUp directory.
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: working with Windows Registry

    Here you go... http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    Unless you have an aversion to using classes, I suggest you use the ATL CRegKey class (all you need to do to use it is include <atlbase.h>).

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: working with Windows Registry

    Quote Originally Posted by YourSurrogateGod View Post
    Why would you do that?
    Because using the Run or RunOnce key in the registry is a valid way to start an app. These keys provide other options that simply copying the app into the startup folder doesn't provide such as starting up the app when the machine starts, for all users or single user, or only start the app once (runonce).

  5. #5
    Join Date
    Apr 2004
    Location
    In the back seat of New Horizons.
    Posts
    1,238

    Re: working with Windows Registry

    Quote Originally Posted by Arjay View Post
    Because using the Run or RunOnce key in the registry is a valid way to start an app. These keys provide other options that simply copying the app into the startup folder doesn't provide such as starting up the app when the machine starts, for all users or single user, or only start the app once (runonce).
    That makes sense if you need the extra options. Based on the OP, the Startup directory would work just fine (no special parameters were mentioned as a pre-req).
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: working with Windows Registry

    Quote Originally Posted by YourSurrogateGod View Post
    That makes sense if you need the extra options. Based on the OP, the Startup directory would work just fine (no special parameters were mentioned as a pre-req).
    It depends by what the OP meant by "needs auto start on windows startup". Does that mean on machine startup or user logon?

  7. #7
    Join Date
    Apr 2004
    Location
    In the back seat of New Horizons.
    Posts
    1,238

    Re: working with Windows Registry

    Quote Originally Posted by Arjay View Post
    It depends by what the OP meant by "needs auto start on windows startup". Does that mean on machine startup or user logon?
    You just have to love interpreting other people's specifications and requirements
    Here are the rules, you must obey them or the gender bender will get you.

    And if you ever think of posting without code-tags, the evil monkey will come after you.

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: working with Windows Registry

    Quote Originally Posted by YourSurrogateGod View Post
    You just have to love interpreting other people's specifications and requirements
    Not really - what I'm saying is that I can't interpret what the OP means by what was written - it just isn't clear.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured