GetRegValue and using it correctly, need help.
-
Ok, so after trying for hours on end to get things working correctly I am posting here. I am new to programming and trying to learn. Please provide me with clarification of how I have this screwed up. Also, please include how I can fix this. I learn through practicals. Also, I have changed things so many times trying to call the function correctly with assigning the correct arguments but I am just so confused at this point I am asking for help.
#define _WIN32_WINNT (0x0601)
#include <windows.h>
#include <winbase.h>
#include <winreg.h>
#include <iostream>
#include <iomanip>
using namespace std;int main()
{
// REGISTRY PORTION
DWORD pdwQuotaAllowed, pdwQuotaUsed;
GetSystemRegistryQuota(&pdwQuotaAllowed, &pdwQuotaUsed);// Backup Current Registry
// Open Registry Key (RegGetValue)
DWORD dwFlags;
RegGetValue(&dwFlags);
// Delete Contents of the Key (RegDeleteValue)
// Write New Content of the key (RegSetValueEx)
// Close Registry Handle (RegCloseKey)// DISPLAY RESULTS
cout << pdwQuotaAllowed << endl;
cout << pdwQuotaUsed << endl;
return 0;
} -
Ok, so after trying for hours on end to get things working correctly I am posting here. I am new to programming and trying to learn. Please provide me with clarification of how I have this screwed up. Also, please include how I can fix this. I learn through practicals. Also, I have changed things so many times trying to call the function correctly with assigning the correct arguments but I am just so confused at this point I am asking for help.
#define _WIN32_WINNT (0x0601)
#include <windows.h>
#include <winbase.h>
#include <winreg.h>
#include <iostream>
#include <iomanip>
using namespace std;int main()
{
// REGISTRY PORTION
DWORD pdwQuotaAllowed, pdwQuotaUsed;
GetSystemRegistryQuota(&pdwQuotaAllowed, &pdwQuotaUsed);// Backup Current Registry
// Open Registry Key (RegGetValue)
DWORD dwFlags;
RegGetValue(&dwFlags);
// Delete Contents of the Key (RegDeleteValue)
// Write New Content of the key (RegSetValueEx)
// Close Registry Handle (RegCloseKey)// DISPLAY RESULTS
cout << pdwQuotaAllowed << endl;
cout << pdwQuotaUsed << endl;
return 0;
}As a newbie to programming I would strongly caution you not to do anything to the registry. If you corrupt an entry you could end up with a totally unusable system. As to the code you posted you need to read the MSDN documentation for details of how to use particular functions, e.g RegGetValue()[^] needs a lot more parameters than you offered. Once again, I would suggest you find something less likely to damage your system to learn on.
txtspeak is the realm of 9 year old children, not developers. Christian Graus