Accessing Windows Registry

Is there anyway I can add information into the Windows 95 registry using C++? If so, how?
GreatOneAsked:
Who is Participating?
 
pagladasuConnect With a Mentor Commented:
Yes, you can.
Try the functions:
WriteProfileInt()
WriteProfileSection()
WriteProfileString()

0
 
GreatOneAuthor Commented:
What library would I have to include to use these functions?

0
 
pagladasuCommented:
What will you be using:
windows SDK or MFC

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
GreatOneAuthor Commented:
I am not using Visual C++, i am using DJGPP to write and compile my program. Can I access the Registry using DJGPP? If not, I would be using MFC.
0
 
pagladasuCommented:
I have not used DJGPP. So, I wouldn't be able to tell.
0
 
fstabCommented:
Use the registry functions : RegOpenKeyEx, RegCloseKey, RegCreateKeyEx, RegDeleteKey, RegOpenKey. The functions WriteProfileInt etc. write only into .INI files NOT the registry.

 

0
 
GreatOneAuthor Commented:
Fstab,
Can I use the functions u described with DJGPP?
0
 
fstabCommented:
What is DJGPP ? :-) Please enlighten me ..
Also these functions are available in the Win32 environment. So if DJGPP supports the Win32 API, I am sure they should work. Otherwise you have an option of going back to MFC - actually these are not MFC functions but Win32 API functions.
0
 
GreatOneAuthor Commented:
Ok I am using Visual C++ to write this program. Using the functions listed by fstab how would I add a value to HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN?

0
 
corneilCommented:
You have to open the key using:
RegOpenKeyEx
Then write the value using:
RegSetValueEx
Then close the registry key using:
RegCloseKey
            
0
All Courses

From novice to tech pro — start learning today.