8#include "hresult_error_intf.hpp"
11#include <system_error>
14hi_export_module(hikogui.win32 : shlobj_core);
16hi_export
namespace hi {
26[[nodiscard]]
inline std::expected<std::filesystem::path, hresult_error>
win32_SHGetKnownFolderPath(KNOWNFOLDERID
const& folder_id)
noexcept
28 PWSTR wpath =
nullptr;
29 auto const result_code = SHGetKnownFolderPath(folder_id, 0,
nullptr, &wpath);
31 if (result_code != S_OK) {
35 auto r = std::filesystem::path{wpath} /
"";
Rules for working with win32 headers.
The HikoGUI namespace.
Definition array_generic.hpp:20
std::expected< std::filesystem::path, hresult_error > win32_SHGetKnownFolderPath(KNOWNFOLDERID const &folder_id) noexcept
Convenience function for SHGetKnownFolderPath().
Definition shlobj_core.hpp:26
DOXYGEN BUG.
Definition algorithm_misc.hpp:20