Hey guys, I was searching alot in google but I could not find a way that worked to read the data of a key. I used this to open the key
But how can I read the data inside? Lets say that "Path" is the directory of the application.
RegOpenKeyEx(HKEY_LOCAL_MACHINE , "Software\\Someapp\\Theapp" , 0 ,
KEY_READ , &location );
RegQueryValueEx(hkey , "Path" , NULL , &data_type ,
(BYTE*)&value , &size);
Shouldn't location be instead of hkey, and I think you got more than 2 erros there... read at msdn or google for more examples.
Okay well I redid the code and now its working.
But now I want to go to that directory I tryed using
int main ()
char rgValue ;
char fnlRes ;
if( RegOpenKeyEx( HKEY_LOCAL_MACHINE,
KEY_QUERY_VALUE, &keyHandle) == ERROR_SUCCESS)
RegQueryValueEx( keyHandle, "Path", NULL, &Type,
printf( "Your path is %s\n", rgValue );
else strcpy(fnlRes,"Somesoft is not installed on your computer!");
And as I expected it didn't work any help?
EDIT: fixed every thing works