Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

startup?

Status
Not open for further replies.

bobo12

Programmer
Dec 26, 2004
74
US
hi,
anyone know how to make a certain visual C++ program load at startup. not only through startup folder but writing to registry?
how do i tackle something like this?
source code is appreciated...thanks
 
for xp, 2000, and 98. is it the same method for each one?

if not, would you plz indicate how i can actually tell which os they are running.
 
Open Regedit and look here:
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
Add your program to that key.
 
hi,
when u say Add your program to that key, is this something that i instruct the installer to do? i hope there is that option in an installer?

if i have misunderstood, please correct.
thanks,
 
It's been a long time since I wrote a program that reads/writes to the registry, but if you look in the MSDN you'll find functions such as: RegOpenKey(), RegCloseKey(), RegCreateKey(), RegSetValue()...

For the hKey value use: "HKEY_LOCAL_MACHINE".

For the lpSubKey value use: "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run".

You need to open the key and get the handle, then use RegSetValue() to set your value (i.e. on the right side of the RegEdit window), then close the key.
 
InstallShield Express 4 has a gui for adding keys during the install, I have to believe that all these super-expensive install programs must. The Nullsoft free installer has the capability.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top