A modded EditSaber for making beat saber maps.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
617 B

5 years ago
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2. #include "RegReader.h"
  3. FString URegReader::ReadRegistryValue(const FString& KeyName, const FString& ValueName)
  4. {
  5. HKEY hKey;
  6. LONG Result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, *KeyName, 0, KEY_READ | KEY_WOW64_32KEY, &hKey);
  7. if (Result != ERROR_SUCCESS)
  8. {
  9. // Handle error
  10. }
  11. TCHAR Buffer[MAX_PATH];
  12. DWORD BufferSize = sizeof(Buffer);
  13. HRESULT hResult = RegQueryValueEx(hKey, *ValueName, 0, nullptr, reinterpret_cast<LPBYTE>(Buffer), &BufferSize);
  14. if (hResult != ERROR_SUCCESS)
  15. {
  16. // Handle error
  17. }
  18. return FString(Buffer);
  19. }