aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/resource.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/resource.hpp25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/resource.hpp b/src/resource.hpp
index 24fc2db..0e3186c 100644
--- a/src/resource.hpp
+++ b/src/resource.hpp
@@ -5,32 +5,13 @@
#pragma once
-#include "error.hpp"
-
-#include <cstddef>
+#include <Windows.h>
#include <string>
namespace resource
{
- HMODULE load_exe_module()
- {
- const auto module = GetModuleHandle(NULL);
- if (module == NULL)
- error::raise("GetModuleHandle");
- return module;
- }
-
- std::wstring load_string(unsigned int id)
- {
- wchar_t* s = nullptr;
-
- const auto ret = LoadStringW(
- load_exe_module(), id, reinterpret_cast<wchar_t*>(&s), 0);
-
- if (ret <= 0)
- error::raise("LoadStringW");
+ HMODULE load_exe_module();
- return {s, static_cast<std::size_t>(ret)};
- }
+ std::wstring load_string(unsigned int id);
}