More Registry Crap
I'm busy writing a tool, but things aren't really going as expected in the windows registry area, I'm trying to read a value from the registry. So if there was a key HKEY_CURRENT_USER\Software\Brian\ and a value Mega which contained the string "Rad" I would expect this code to extract the value Rad for me.
int WINAPI WinMain (HINSTANCE hi, HINSTANCE hpi, LPSTR arg, int nfs)
DWORD cbData = 7;
RegOpenKey(HKEY_CURRENT_USER, "Software\\Brian", &fdkey);
RegQueryValue(fdkey, "Mega", dir, NULL);
The fourth parameter to RegQueryValue is the size of the buffer denoted in the third parameter.