DivZr0
February 14th, 2005, 11:16 AM
Hey guys, I'm fairly a newbie to C++ and I'm also out of my leauge here, I read a little in the forums about how to read registry keys, apparently I just can't get it. I'm just trying to read a simple key with a console application.
#include "StdAfx.h"
#include <windows.h>
#include <iostream.h>
#include <iomanip.h>
#include <string.h>
#include <stdlib.h>
void main ()
{
HKEY hKey;
DWORD dwType;
DWORD dwSize;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software",0 , KEY_READ, &hKey);
RegOpenKeyEx(hKey, "Dev-C++", 0, KEY_READ, &hKey);
cout << RegQueryValueEx(hKey, "Install_Dir", NULL, &dwType, NULL, &dwSize) <<endl;
}
Thanks muchly for your help
#include "StdAfx.h"
#include <windows.h>
#include <iostream.h>
#include <iomanip.h>
#include <string.h>
#include <stdlib.h>
void main ()
{
HKEY hKey;
DWORD dwType;
DWORD dwSize;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software",0 , KEY_READ, &hKey);
RegOpenKeyEx(hKey, "Dev-C++", 0, KEY_READ, &hKey);
cout << RegQueryValueEx(hKey, "Install_Dir", NULL, &dwType, NULL, &dwSize) <<endl;
}
Thanks muchly for your help