8#include "win32_error_intf.hpp"
11#include <system_error>
14hi_export_module(hikogui.win32 : libloaderapi);
16hi_export
namespace hi {
19[[nodiscard]]
inline std::expected<std::filesystem::path, win32_error> win32_GetModuleFileName(HMODULE module_handle = NULL)
noexcept
22 auto buffer_size = MAX_PATH;
23 static_assert(MAX_PATH != 0);
27 module_path.
resize(buffer_size);
28 auto num_chars = GetModuleFileNameW(module_handle, module_path.
data(), buffer_size);
32 }
else if (num_chars < module_path.
length()) {
33 module_path.
resize(num_chars);
34 return std::filesystem::path{module_path};
Rules for working with win32 headers.
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20