Click here to Skip to main content
15,907,000 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to read a key from the registry location HKEY_LOCAL_MACHINE\SOFTWARE\TortoiseSVN.
I saw various samples in C#. But couldn't find one written in C.
Can anyone help me?
Posted

Does this code help you?
C++
#define BUFFER 8192

int main()
{
	char value[255];
	DWORD BufferSize = BUFFER;
	RegGetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "SystemRoot", RRF_RT_ANY, NULL, (PVOID)&value, &BufferSize);
	std::cout << value << std::endl;
	system("pause");


Referred Dreamincode[^]
 
Share this answer
 
v2
Comments
Deepak Joy Jose 4-May-12 4:38am    
Thanx for your help. It seems working to me.
Chandrasekharan P 4-May-12 5:40am    
Glad it helped you.
Prasad_Kulkarni 4-May-12 6:49am    
My 5!
You should get familiar with the MSDN documentation[^] for the Windows API.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900