diff options
Diffstat (limited to 'src/platform/gui/win')
-rw-r--r-- | src/platform/gui/win/Clipboard.cpp | 11 | ||||
-rw-r--r-- | src/platform/gui/win/Cursor.cpp | 2 | ||||
-rw-r--r-- | src/platform/gui/win/GodWindow.cpp | 2 | ||||
-rw-r--r-- | src/platform/gui/win/InputMethod.cpp | 46 | ||||
-rw-r--r-- | src/platform/gui/win/Keyboard.cpp | 6 | ||||
-rw-r--r-- | src/platform/gui/win/Resource.cpp | 3 | ||||
-rw-r--r-- | src/platform/gui/win/TimerManager.cpp | 3 | ||||
-rw-r--r-- | src/platform/gui/win/TimerManager.h | 3 | ||||
-rw-r--r-- | src/platform/gui/win/UiApplication.cpp | 5 | ||||
-rw-r--r-- | src/platform/gui/win/Window.cpp | 68 | ||||
-rw-r--r-- | src/platform/gui/win/WindowClass.cpp | 2 |
11 files changed, 81 insertions, 70 deletions
diff --git a/src/platform/gui/win/Clipboard.cpp b/src/platform/gui/win/Clipboard.cpp index 5525cb40..1ffb0254 100644 --- a/src/platform/gui/win/Clipboard.cpp +++ b/src/platform/gui/win/Clipboard.cpp @@ -1,4 +1,6 @@ #include "cru/platform/gui/win/Clipboard.h" +#include <string> +#include "cru/base/StringUtil.h" #include "cru/base/log/Logger.h" #include "cru/platform/gui/win/GodWindow.h" #include "cru/platform/gui/win/UiApplication.h" @@ -9,7 +11,7 @@ WinClipboard::WinClipboard(WinUiApplication* application) WinClipboard::~WinClipboard() {} -String WinClipboard::GetText() { +std::string WinClipboard::GetText() { auto god_window = application_->GetGodWindow(); if (!::OpenClipboard(god_window->GetHandle())) { @@ -36,15 +38,16 @@ String WinClipboard::GetText() { return {}; } - String result(static_cast<wchar_t*>(ptr)); + std::wstring result(static_cast<wchar_t*>(ptr)); ::GlobalUnlock(handle); ::CloseClipboard(); - return result; + return string::ToUtf8(result); } -void WinClipboard::SetText(String text) { +void WinClipboard::SetText(std::string utf8_text) { + auto text = string::ToUtf16(utf8_text); auto god_window = application_->GetGodWindow(); if (!::OpenClipboard(god_window->GetHandle())) { diff --git a/src/platform/gui/win/Cursor.cpp b/src/platform/gui/win/Cursor.cpp index 24e9c2fc..c5424eb4 100644 --- a/src/platform/gui/win/Cursor.cpp +++ b/src/platform/gui/win/Cursor.cpp @@ -27,7 +27,7 @@ WinCursor* LoadWinCursor(const wchar_t* name) { const auto handle = static_cast<HCURSOR>(::LoadImageW( NULL, name, IMAGE_CURSOR, SM_CYCURSOR, SM_CYCURSOR, LR_SHARED)); if (handle == NULL) { - throw Win32Error(::GetLastError(), u"Failed to load system cursor."); + throw Win32Error(::GetLastError(), "Failed to load system cursor."); } return new WinCursor(handle, false); } diff --git a/src/platform/gui/win/GodWindow.cpp b/src/platform/gui/win/GodWindow.cpp index 485eae72..7f24fd17 100644 --- a/src/platform/gui/win/GodWindow.cpp +++ b/src/platform/gui/win/GodWindow.cpp @@ -37,7 +37,7 @@ GodWindow::GodWindow(WinUiApplication* application) { HWND_MESSAGE, nullptr, h_instance, nullptr); if (hwnd_ == nullptr) - throw Win32Error(::GetLastError(), u"Failed to create god window."); + throw Win32Error(::GetLastError(), "Failed to create god window."); } GodWindow::~GodWindow() { diff --git a/src/platform/gui/win/InputMethod.cpp b/src/platform/gui/win/InputMethod.cpp index 94795c8c..6f5955fb 100644 --- a/src/platform/gui/win/InputMethod.cpp +++ b/src/platform/gui/win/InputMethod.cpp @@ -2,9 +2,7 @@ #include "cru/base/StringUtil.h" #include "cru/base/log/Logger.h" -#include "cru/platform/Check.h" #include "cru/platform/gui/DebugFlags.h" -#include "cru/platform/gui/win/Exception.h" #include "cru/platform/gui/win/Window.h" #include <vector> @@ -104,19 +102,19 @@ CompositionClauses GetCompositionClauses(HIMC imm_context, int target_start, return result; } -String GetString(HIMC imm_context) { +std::wstring GetString(HIMC imm_context) { LONG string_size = ::ImmGetCompositionString(imm_context, GCS_COMPSTR, NULL, 0); - String result((string_size / sizeof(char16_t)), 0); + std::wstring result((string_size / sizeof(wchar_t)), 0); ::ImmGetCompositionString(imm_context, GCS_COMPSTR, result.data(), string_size); return result; } -String GetResultString(HIMC imm_context) { +std::wstring GetResultString(HIMC imm_context) { LONG string_size = ::ImmGetCompositionString(imm_context, GCS_RESULTSTR, NULL, 0); - String result((string_size / sizeof(char16_t)), 0); + std::wstring result((string_size / sizeof(wchar_t)), 0); ::ImmGetCompositionString(imm_context, GCS_RESULTSTR, result.data(), string_size); return result; @@ -126,17 +124,35 @@ CompositionText GetCompositionInfo(HIMC imm_context) { // We only care about GCS_COMPATTR, GCS_COMPCLAUSE and GCS_CURSORPOS, and // convert them into underlines and selection range respectively. - auto text = GetString(imm_context); + auto utf16_text = GetString(imm_context); + auto text = string::ToUtf8(utf16_text); - int length = static_cast<int>(text.length()); + int length = static_cast<int>(utf16_text.length()); // Find out the range selected by the user. int target_start = length; int target_end = length; GetCompositionTargetRange(imm_context, &target_start, &target_end); auto clauses = GetCompositionClauses(imm_context, target_start, target_end); + for (auto& clause : clauses) { + clause.start = string::Utf8IndexCodePointToCodeUnit( + text.data(), text.size(), + string::Utf16IndexCodeUnitToCodePoint( + reinterpret_cast<const char16_t*>(utf16_text.data()), + utf16_text.size(), clause.start)); + clause.end = string::Utf8IndexCodePointToCodeUnit( + text.data(), text.size(), + string::Utf16IndexCodeUnitToCodePoint( + reinterpret_cast<const char16_t*>(utf16_text.data()), + utf16_text.size(), clause.end)); + } - int cursor = ::ImmGetCompositionString(imm_context, GCS_CURSORPOS, NULL, 0); + int cursor = string::Utf8IndexCodePointToCodeUnit( + text.data(), text.size(), + string::Utf16IndexCodeUnitToCodePoint( + reinterpret_cast<const char16_t*>(utf16_text.data()), + utf16_text.size(), + ::ImmGetCompositionString(imm_context, GCS_CURSORPOS, NULL, 0))); return CompositionText{std::move(text), std::move(clauses), TextRange{cursor}}; @@ -215,7 +231,7 @@ IEvent<std::nullptr_t>* WinInputMethodContext::CompositionEvent() { return &composition_event_; } -IEvent<StringView>* WinInputMethodContext::TextEvent() { return &text_event_; } +IEvent<std::string>* WinInputMethodContext::TextEvent() { return &text_event_; } void WinInputMethodContext::OnWindowNativeMessage( WindowNativeMessageEventArgs& args) { @@ -223,7 +239,7 @@ void WinInputMethodContext::OnWindowNativeMessage( switch (message.msg) { case WM_CHAR: { auto c = static_cast<char16_t>(message.w_param); - if (IsUtf16SurrogatePairCodeUnit(c)) { + if (cru::string::IsUtf16SurrogatePairCodeUnit(c)) { // I don't think this will happen because normal key strike without ime // should only trigger ascci character. If it is a charater from // supplementary planes, it should be handled with ime messages. @@ -233,9 +249,7 @@ void WinInputMethodContext::OnWindowNativeMessage( } else { if (c != '\b') { // ignore backspace if (c == '\r') c = '\n'; // Change \r to \n - - char16_t s[1] = {c}; - text_event_.Raise({s, 1}); + text_event_.Raise(std::string{static_cast<char>(c)}); } } args.HandleWithResult(0); @@ -271,10 +285,10 @@ void WinInputMethodContext::OnWindowNativeMessage( } } -String WinInputMethodContext::GetResultString() { +std::string WinInputMethodContext::GetResultString() { auto himc = GetHIMC(); auto result = win::GetResultString(himc.Get()); - return result; + return string::ToUtf8(result); } AutoHIMC WinInputMethodContext::GetHIMC() { diff --git a/src/platform/gui/win/Keyboard.cpp b/src/platform/gui/win/Keyboard.cpp index 85a6576a..f4286fbc 100644 --- a/src/platform/gui/win/Keyboard.cpp +++ b/src/platform/gui/win/Keyboard.cpp @@ -66,9 +66,9 @@ KeyCode VirtualKeyToKeyCode(int virtual_key) { KeyModifier RetrieveKeyMofifier() { KeyModifier result{0}; - if (::GetKeyState(VK_SHIFT) < 0) result |= KeyModifiers::shift; - if (::GetKeyState(VK_CONTROL) < 0) result |= KeyModifiers::ctrl; - if (::GetKeyState(VK_MENU) < 0) result |= KeyModifiers::alt; + if (::GetKeyState(VK_SHIFT) < 0) result |= KeyModifiers::Shift; + if (::GetKeyState(VK_CONTROL) < 0) result |= KeyModifiers::Ctrl; + if (::GetKeyState(VK_MENU) < 0) result |= KeyModifiers::Alt; return result; } } // namespace cru::platform::gui::win diff --git a/src/platform/gui/win/Resource.cpp b/src/platform/gui/win/Resource.cpp index 45189464..6fb4d634 100644 --- a/src/platform/gui/win/Resource.cpp +++ b/src/platform/gui/win/Resource.cpp @@ -1,6 +1,5 @@ #include "cru/platform/gui/win/Resource.h" -#include "cru/platform/gui/win/Window.h" namespace cru::platform::gui::win { -String WinNativeResource::kPlatformId = u"Windows"; +std::string WinNativeResource::kPlatformId = "Windows"; } diff --git a/src/platform/gui/win/TimerManager.cpp b/src/platform/gui/win/TimerManager.cpp index c6128b85..3fc9afe4 100644 --- a/src/platform/gui/win/TimerManager.cpp +++ b/src/platform/gui/win/TimerManager.cpp @@ -4,7 +4,6 @@ #include "cru/platform/gui/win/Exception.h" #include <functional> -#include <type_traits> namespace cru::platform::gui::win { constexpr int kSetImmediateWindowMessageId = WM_USER + 2000; @@ -25,7 +24,7 @@ long long TimerManager::SetTimer(TimerType type, int period, static_cast<UINT_PTR>(id), 0)) { throw Win32Error( ::GetLastError(), - u"Failed to post window message to god window for set immediate."); + "Failed to post window message to god window for set immediate."); } } else { CreateNativeTimer(&timer_info); diff --git a/src/platform/gui/win/TimerManager.h b/src/platform/gui/win/TimerManager.h index b3f4aa38..2492a048 100644 --- a/src/platform/gui/win/TimerManager.h +++ b/src/platform/gui/win/TimerManager.h @@ -1,14 +1,11 @@ #pragma once #include "cru/base/Event.h" -#include "cru/platform/win/WinPreConfig.h" #include "cru/base/Base.h" #include "cru/platform/gui/win/GodWindow.h" #include "cru/platform/gui/win/WindowNativeMessageEventArgs.h" -#include <chrono> #include <functional> -#include <optional> #include <unordered_map> namespace cru::platform::gui::win { diff --git a/src/platform/gui/win/UiApplication.cpp b/src/platform/gui/win/UiApplication.cpp index 5be1a5d2..9909cd47 100644 --- a/src/platform/gui/win/UiApplication.cpp +++ b/src/platform/gui/win/UiApplication.cpp @@ -2,15 +2,12 @@ #include "TimerManager.h" #include "WindowManager.h" -#include "cru/base/log/Logger.h" -#include "cru/platform/Check.h" #include "cru/platform/graphics/direct2d/Factory.h" #include "cru/platform/gui/win/Base.h" #include "cru/platform/gui/win/Clipboard.h" #include "cru/platform/gui/win/Cursor.h" #include "cru/platform/gui/win/Exception.h" #include "cru/platform/gui/win/GodWindow.h" -#include "cru/platform/gui/win/InputMethod.h" #include "cru/platform/gui/win/Window.h" namespace cru::platform::gui { @@ -27,7 +24,7 @@ WinUiApplication::WinUiApplication() { instance_handle_ = ::GetModuleHandleW(nullptr); if (!instance_handle_) - throw Win32Error(u"Failed to get module(instance) handle."); + throw Win32Error("Failed to get module(instance) handle."); ::SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); diff --git a/src/platform/gui/win/Window.cpp b/src/platform/gui/win/Window.cpp index eeb2cde4..9a9a7275 100644 --- a/src/platform/gui/win/Window.cpp +++ b/src/platform/gui/win/Window.cpp @@ -1,13 +1,14 @@ #include "cru/platform/gui/win/Window.h" #include "WindowManager.h" +#include "cru/base/StringUtil.h" #include "cru/base/log/Logger.h" #include "cru/platform/Check.h" #include "cru/platform/graphics/NullPainter.h" -#include "cru/platform/gui/Base.h" +#include "cru/platform/graphics/direct2d/WindowPainter.h" #include "cru/platform/gui/DebugFlags.h" +#include "cru/platform/gui/Input.h" #include "cru/platform/gui/Window.h" -#include "cru/platform/graphics/direct2d/WindowPainter.h" #include "cru/platform/gui/win/Cursor.h" #include "cru/platform/gui/win/Exception.h" #include "cru/platform/gui/win/InputMethod.h" @@ -42,7 +43,7 @@ Rect CalcWindowRectFromClient(const Rect& rect, WindowStyleFlag style_flag, r.right = DipToPixel(rect.GetRight(), dpi); r.bottom = DipToPixel(rect.GetBottom(), dpi); if (!AdjustWindowRectEx(&r, CalcWindowStyle(style_flag), FALSE, 0)) - throw Win32Error(::GetLastError(), u"Failed to invoke AdjustWindowRectEx."); + throw Win32Error(::GetLastError(), "Failed to invoke AdjustWindowRectEx."); Rect result = Rect::FromVertices(PixelToDip(r.left, dpi), PixelToDip(r.top, dpi), @@ -55,7 +56,7 @@ Rect CalcClientRectFromWindow(const Rect& rect, WindowStyleFlag style_flag, RECT o{100, 100, 500, 500}; RECT s = o; if (!AdjustWindowRectEx(&s, CalcWindowStyle(style_flag), FALSE, 0)) - throw Win32Error(::GetLastError(), u"Failed to invoke AdjustWindowRectEx."); + throw Win32Error(::GetLastError(), "Failed to invoke AdjustWindowRectEx."); Rect result = rect; result.Shrink(Thickness(PixelToDip(s.left - o.left, dpi), @@ -87,13 +88,14 @@ void WinNativeWindow::SetParent(INativeWindow* parent) { } } -String WinNativeWindow::GetTitle() { return title_; } +std::string WinNativeWindow::GetTitle() { return title_; } -void WinNativeWindow::SetTitle(String title) { +void WinNativeWindow::SetTitle(std::string title) { title_ = title; if (hwnd_) { - ::SetWindowTextW(hwnd_, title_.WinCStr()); + auto utf16_text = string::ToUtf16(title); + ::SetWindowTextW(hwnd_, utf16_text.c_str()); } } @@ -135,7 +137,7 @@ void WinNativeWindow::SetClientSize(const Size& size) { if (!SetWindowPos(hwnd_, nullptr, 0, 0, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_NOMOVE)) - throw Win32Error(::GetLastError(), u"Failed to invoke SetWindowPos."); + throw Win32Error(::GetLastError(), "Failed to invoke SetWindowPos."); } } @@ -150,7 +152,7 @@ void WinNativeWindow::SetClientRect(const Rect& rect) { if (!SetWindowPos(hwnd_, nullptr, 0, 0, r.right - r.left, r.bottom - r.top, SWP_NOZORDER | SWP_NOMOVE)) - throw Win32Error(::GetLastError(), u"Failed to invoke SetWindowPos."); + throw Win32Error(::GetLastError(), "Failed to invoke SetWindowPos."); } } @@ -158,7 +160,7 @@ Rect WinNativeWindow::GetWindowRect() { if (hwnd_) { RECT rect; if (!::GetWindowRect(hwnd_, &rect)) - throw Win32Error(::GetLastError(), u"Failed to invoke GetWindowRect."); + throw Win32Error(::GetLastError(), "Failed to invoke GetWindowRect."); return Rect::FromVertices(PixelToDip(rect.left), PixelToDip(rect.top), PixelToDip(rect.right), PixelToDip(rect.bottom)); @@ -174,7 +176,7 @@ void WinNativeWindow::SetWindowRect(const Rect& rect) { if (!SetWindowPos(hwnd_, nullptr, DipToPixel(rect.left), DipToPixel(rect.top), DipToPixel(rect.GetRight()), DipToPixel(rect.GetBottom()), SWP_NOZORDER)) - throw Win32Error(::GetLastError(), u"Failed to invoke SetWindowPos."); + throw Win32Error(::GetLastError(), "Failed to invoke SetWindowPos."); } } @@ -189,9 +191,9 @@ bool WinNativeWindow::RequestFocus() { Point WinNativeWindow::GetMousePosition() { POINT p; if (!::GetCursorPos(&p)) - throw Win32Error(::GetLastError(), u"Failed to get cursor position."); + throw Win32Error(::GetLastError(), "Failed to get cursor position."); if (!::ScreenToClient(hwnd_, &p)) - throw Win32Error(::GetLastError(), u"Failed to call ScreenToClient."); + throw Win32Error(::GetLastError(), "Failed to call ScreenToClient."); return PixelToDip(p); } @@ -210,9 +212,9 @@ void WinNativeWindow::RequestRepaint() { CRU_LOG_TAG_DEBUG("A repaint is requested."); } if (!::InvalidateRect(hwnd_, nullptr, FALSE)) - throw Win32Error(::GetLastError(), u"Failed to invalidate window."); + throw Win32Error(::GetLastError(), "Failed to invalidate window."); if (!::UpdateWindow(hwnd_)) - throw Win32Error(::GetLastError(), u"Failed to update window."); + throw Win32Error(::GetLastError(), "Failed to update window."); } std::unique_ptr<graphics::IPainter> WinNativeWindow::BeginPaint() { @@ -243,34 +245,34 @@ void WinNativeWindow::SetCursor(std::shared_ptr<ICursor> cursor) { if (GetVisibility() != WindowVisibilityType::Show) return; - auto lg = [](StringView reason) { + auto lg = [](std::string_view reason) { CRU_LOG_TAG_WARN( "Failed to set cursor because {} when window is visible. (We need to " "update cursor if it is inside the window.) Last error code: {}.", - reason.ToUtf8(), ::GetLastError()); + reason, ::GetLastError()); }; ::POINT point; if (!::GetCursorPos(&point)) { - lg(u"failed to get cursor pos"); + lg("failed to get cursor pos"); return; } ::RECT rect; if (!::GetClientRect(hwnd_, &rect)) { - lg(u"failed to get window's client rect"); + lg("failed to get window's client rect"); return; } ::POINT lefttop{rect.left, rect.top}; ::POINT rightbottom{rect.right, rect.bottom}; if (!::ClientToScreen(hwnd_, &lefttop)) { - lg(u"failed to call ClientToScreen on lefttop"); + lg("failed to call ClientToScreen on lefttop"); return; } if (!::ClientToScreen(hwnd_, &rightbottom)) { - lg(u"failed to call ClientToScreen on rightbottom"); + lg("failed to call ClientToScreen on rightbottom"); return; } @@ -283,8 +285,7 @@ void WinNativeWindow::SetCursor(std::shared_ptr<ICursor> cursor) { void WinNativeWindow::SetToForeground() { if (hwnd_) { if (!::SetForegroundWindow(hwnd_)) - throw Win32Error(::GetLastError(), - u"Failed to set window to foreground."); + throw Win32Error(::GetLastError(), "Failed to set window to foreground."); } } @@ -331,7 +332,7 @@ bool WinNativeWindow::HandleNativeWindowMessage(HWND hwnd, UINT msg, POINT point; point.x = GET_X_LPARAM(l_param); point.y = GET_Y_LPARAM(l_param); - OnMouseDownInternal(platform::gui::mouse_buttons::left, point); + OnMouseDownInternal(platform::gui::MouseButtons::Left, point); *result = 0; return true; } @@ -339,7 +340,7 @@ bool WinNativeWindow::HandleNativeWindowMessage(HWND hwnd, UINT msg, POINT point; point.x = GET_X_LPARAM(l_param); point.y = GET_Y_LPARAM(l_param); - OnMouseUpInternal(platform::gui::mouse_buttons::left, point); + OnMouseUpInternal(platform::gui::MouseButtons::Left, point); *result = 0; return true; } @@ -347,7 +348,7 @@ bool WinNativeWindow::HandleNativeWindowMessage(HWND hwnd, UINT msg, POINT point; point.x = GET_X_LPARAM(l_param); point.y = GET_Y_LPARAM(l_param); - OnMouseDownInternal(platform::gui::mouse_buttons::right, point); + OnMouseDownInternal(platform::gui::MouseButtons::Right, point); *result = 0; return true; } @@ -355,7 +356,7 @@ bool WinNativeWindow::HandleNativeWindowMessage(HWND hwnd, UINT msg, POINT point; point.x = GET_X_LPARAM(l_param); point.y = GET_Y_LPARAM(l_param); - OnMouseUpInternal(platform::gui::mouse_buttons::right, point); + OnMouseUpInternal(platform::gui::MouseButtons::Right, point); *result = 0; return true; } @@ -363,7 +364,7 @@ bool WinNativeWindow::HandleNativeWindowMessage(HWND hwnd, UINT msg, POINT point; point.x = GET_X_LPARAM(l_param); point.y = GET_Y_LPARAM(l_param); - OnMouseDownInternal(platform::gui::mouse_buttons::middle, point); + OnMouseDownInternal(platform::gui::MouseButtons::Middle, point); *result = 0; return true; } @@ -371,7 +372,7 @@ bool WinNativeWindow::HandleNativeWindowMessage(HWND hwnd, UINT msg, POINT point; point.x = GET_X_LPARAM(l_param); point.y = GET_Y_LPARAM(l_param); - OnMouseUpInternal(platform::gui::mouse_buttons::middle, point); + OnMouseUpInternal(platform::gui::MouseButtons::Middle, point); *result = 0; return true; } @@ -455,7 +456,7 @@ bool WinNativeWindow::HandleNativeWindowMessage(HWND hwnd, UINT msg, RECT WinNativeWindow::GetClientRectPixel() { RECT rect; if (!::GetClientRect(hwnd_, &rect)) - throw Win32Error(::GetLastError(), u"Failed to invoke GetClientRect."); + throw Win32Error(::GetLastError(), "Failed to invoke GetClientRect."); return rect; } @@ -470,11 +471,11 @@ void WinNativeWindow::RecreateWindow() { nullptr, application_->GetInstanceHandle(), nullptr); if (hwnd_ == nullptr) - throw Win32Error(::GetLastError(), u"Failed to create window."); + throw Win32Error(::GetLastError(), "Failed to create window."); auto dpi = ::GetDpiForWindow(hwnd_); if (dpi == 0) - throw Win32Error(::GetLastError(), u"Failed to get dpi of window."); + throw Win32Error(::GetLastError(), "Failed to get dpi of window."); dpi_ = static_cast<float>(dpi); CRU_LOG_TAG_DEBUG("Dpi of window is {}.", dpi_); @@ -483,7 +484,8 @@ void WinNativeWindow::RecreateWindow() { SetCursor(application_->GetCursorManager()->GetSystemCursor( cru::platform::gui::SystemCursorType::Arrow)); - ::SetWindowTextW(hwnd_, title_.WinCStr()); + auto utf16_title = string::ToUtf16(title_); + ::SetWindowTextW(hwnd_, utf16_title.c_str()); window_render_target_ = std::make_unique<graphics::direct2d::D2DWindowRenderTarget>( diff --git a/src/platform/gui/win/WindowClass.cpp b/src/platform/gui/win/WindowClass.cpp index cac50eda..67ff4710 100644 --- a/src/platform/gui/win/WindowClass.cpp +++ b/src/platform/gui/win/WindowClass.cpp @@ -23,6 +23,6 @@ WindowClass::WindowClass(std::wstring name, WNDPROC window_proc, atom_ = ::RegisterClassExW(&window_class); if (atom_ == 0) - throw Win32Error(::GetLastError(), u"Failed to create window class."); + throw Win32Error(::GetLastError(), "Failed to create window class."); } } // namespace cru::platform::gui::win |