Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / April 2006

Tip: Looking for answers? Try searching our database.

Windows Registry

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric D. Anderson - 08 Apr 2006 06:09 GMT
I'm writing a program in C and I am wondering if there is a way to write to the registry?

For example, just to throw a line out there(cause its the only path I can think of off the top of my head)...if I wanted to write to "HKEY_CLASSES_ROOT\exefile\shell\open\command" how would I go about implementing it in my code ?

Signature

Eric D. Anderson
Information Technology

Bruno van Dooren - 08 Apr 2006 07:49 GMT
 I'm writing a program in C and I am wondering if there is a way to write to the registry?

 For example, just to throw a line out there(cause its the only path I can think of off the top of my head)...if I wanted to write to "HKEY_CLASSES_ROOT\exefile\shell\open\command" how would I go about implementing it in my code ?

 --
 Eric D. Anderson
 Information Technology

In C++ - C++/CLI there are all kinds of easy-to-use class libraries, but I couldn't find any quickly for C.

If you are using plain C, then you have to use the win32 registry functions.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/re
gistry_functions.asp


Signature

Kind regards,
   Bruno van Dooren
   bruno_nos_pam_van_dooren@hotmail.com
   Remove only "_nos_pam"

William DePalo [MVP VC++] - 08 Apr 2006 16:34 GMT
> I'm writing a program in C and I am wondering if there is a way
> to write to the registry?

I see that Bruno has already pointed you to the Registry API. That's the
"right" way to do it.

If your needs are minimal, you may be able to avoid the tedious
open/update/close trio of operations with wrappers provided by the shell :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platfor
m/shell/reference/shlwapi/registry/reg.asp


for example SHSetValue(). Of course, the wrappers have no choice but to do
the open/update/close operations so if you find yourself manipulating the
same key often, it would be wiser to do it the right way.

Regards,
Will
Eric D. Anderson - 08 Apr 2006 18:01 GMT
Thanks for the replies!

 I'm writing a program in C and I am wondering if there is a way to write to the registry?

 For example, just to throw a line out there(cause its the only path I can think of off the top of my head)...if I wanted to write to "HKEY_CLASSES_ROOT\exefile\shell\open\command" how would I go about implementing it in my code ?

 --
 Eric D. Anderson
 Information Technology

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.