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
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.
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>).
Re: working with Windows Registry
Quote:
Originally Posted by
YourSurrogateGod
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).
Re: working with Windows Registry
Quote:
Originally Posted by
Arjay
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).
Re: working with Windows Registry
Quote:
Originally Posted by
YourSurrogateGod
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?
Re: working with Windows Registry
Quote:
Originally Posted by
Arjay
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 :)
Re: working with Windows Registry
Quote:
Originally Posted by
YourSurrogateGod
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.