473,410 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

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 1482

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Paul Rubin | last post by:
As what must be penance for something or other, I'm needing to release a Python app for use under Windows XP. Please be gentle with me since I'm a Un*x weenie and the only thing I've had much...
5
by: Dhilip Kumar | last post by:
Hi All, I'm writing a Windows Service app using C#. I need to read some configuration settings before the service starts up. These settings will be used by the service in its operation. ...
3
by: Mark Findlay | last post by:
When programming reads of the Windows Registry, do the registry keys and values need to be localized for international use? For example, do I need to convert the key name...
27
by: pisquem | last post by:
I am building an windows service that is to be deployed on a windows server 2003 and I want to have activity written to the event log, I want its own log called ('CustomLog') Below is what I...
16
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I'm looking for a way to programmatically retrieve the following if possible: Windows Installation Key or COA from the registry Windows installed...
5
by: =?Utf-8?B?Qkw=?= | last post by:
Hello friends In c# 2005 I have written a function to access "font file name" by "Font name" and it is working fine in all the windows version other than vista, in vista it is throughing an...
2
by: =?Utf-8?B?SnJ4dHVzZXIx?= | last post by:
I just started using Windows Live OneCare, I had been using Norton, but was unable to fix the problems I was having. I have yet been unsuccessful with OneCare as well. I keep getting the same...
3
by: thephatp | last post by:
BLUF: I need to build up the actual %TEMP% path for all users methodically using values in the registry, and I need to do this both by the current user AND as a service will do this running as...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Description NOTE- If you are unfamiliar with the concept of autoruns, then read "Windows Autorun FAQs: Overview". Que-1: How can I safely remove or edit the autorun...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.