8#include "win32_error_intf.hpp"
11#include <system_error>
13hi_export_module(hikogui.win32 : synchapi);
15hi_export
namespace hi {
18[[nodiscard]]
inline std::expected<HANDLE, win32_error> win32_CreateEvent(
19 SECURITY_ATTRIBUTES
const *event_attributes =
nullptr,
20 bool manual_reset =
true,
21 bool initial_state =
false,
22 std::optional<std::string> name = std::nullopt)
noexcept
25 wchar_t const *name_cstr =
nullptr;
28 name_wstr = *name_wstr_;
29 name_cstr = name_wstr.
c_str();
35 if (
auto r = CreateEventW(
const_cast<SECURITY_ATTRIBUTES *
>(event_attributes), manual_reset, initial_state, name_cstr); r != NULL) {
Rules for working with win32 headers.
The HikoGUI namespace.
Definition array_generic.hpp:20
std::expected< std::wstring, win32_error > win32_MultiByteToWideChar(std::string_view s, unsigned int code_page=CP_UTF8, uint32_t flags=0) noexcept
Convert a win32-API compatible std::wstring to a multi-byte std::string.
Definition stringapiset.hpp:58
DOXYGEN BUG.
Definition algorithm_misc.hpp:20