Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. #pragma once
  2. #define _CRT_SECURE_NO_WARNINGS
  3. #include <string>
  4. #include <windows.h>
  5. #include <string>
  6. #include <assert.h>
  7. #include <process.h>
  8. class CRegistry
  9. {
  10. protected:
  11. HKEY _hKey;
  12. bool error_success;
  13. bool GetRegister(LPCSTR lpName, DWORD dwType, void* outBuf, DWORD size);
  14. bool SetRegister(LPCSTR lpName, DWORD dwType, void* inBuf, DWORD size);
  15. bool GetRegisterDefault(LPSTR outBuf, LONG maxSize);
  16. bool SetRegisterDefault(LPCSTR inBuf);
  17. bool DeleteRegister(LPCSTR lpName);
  18. bool AutoSizeWrite(DWORD dwType, void* inBuf, DWORD &size);
  19. bool AutoSizeRead(DWORD dwType, void* outBuf, DWORD &size);
  20. CRegistry(HKEY hKey, LPCSTR lpSubKey, bool mode);
  21. ~CRegistry();
  22. };
  23. class CEasyRegistry : CRegistry
  24. {
  25. public:
  26. bool no_error;
  27. bool ErrorSuccess();
  28. void WriteString(LPCSTR lpName, LPSTR lpString, ...);
  29. std::string ReadString(LPCSTR lpName);
  30. void WriteInteger(LPCSTR lpName, int value);
  31. int ReadInteger(LPCSTR lpName);
  32. void WriteFloat(LPCSTR lpName, float value);
  33. float ReadFloat(LPCSTR lpName);
  34. void WriteLongLong(LPCSTR lpName, long long value);
  35. long long ReadLongLong(LPCSTR lpName);
  36. void WriteDouble(LPCSTR lpName, double value);
  37. double ReadDouble(LPCSTR lpName);
  38. void DeleteKey(LPCSTR lpName);
  39. bool IsError();
  40. CEasyRegistry(HKEY hKey, LPCSTR lpSubKey, bool mode);
  41. ~CEasyRegistry();
  42. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement