470,848 Members | 1,763 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Windows Registry

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
Apr 8 '06 #1
3 1351

"Eric D. Anderson" <ti*********@email.uophx.edu> wrote in message news:uu**************@TK2MSFTNGP05.phx.gbl...
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/de..._functions.asp

--

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

Apr 8 '06 #2
"Eric D. Anderson" <ti*********@email.uophx.edu> wrote in message
news:uu**************@TK2MSFTNGP05.phx.gbl...
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/de...gistry/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

Apr 8 '06 #3
Thanks for the replies!

--
Eric D. Anderson
"Eric D. Anderson" <ti*********@email.uophx.edu> wrote in message news:uu**************@TK2MSFTNGP05.phx.gbl...
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
Apr 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Paul Rubin | last post: by
3 posts views Thread by Mark Findlay | last post: by
27 posts views Thread by pisquem | last post: by
16 posts views Thread by eSolTec, Inc. 501(c)(3) | last post: by
5 posts views Thread by =?Utf-8?B?Qkw=?= | last post: by
2 posts views Thread by =?Utf-8?B?SnJ4dHVzZXIx?= | last post: by
3 posts views Thread by thephatp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.