From a2c2089c8d97b4910d4287c14c82e20d33366c24 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 29 Jan 2022 21:25:15 +0800 Subject: ... --- src/win/gui/Window.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/win/gui/Window.cpp b/src/win/gui/Window.cpp index 2bd29476..f30b4e59 100644 --- a/src/win/gui/Window.cpp +++ b/src/win/gui/Window.cpp @@ -281,6 +281,14 @@ void WinNativeWindow::SetCursor(std::shared_ptr cursor) { } } +void WinNativeWindow::SetToForeground() { + if (hwnd_) { + if (!::SetForegroundWindow(hwnd_)) + throw Win32Error(::GetLastError(), + u"Failed to set window to foreground."); + } +} + IInputMethodContext* WinNativeWindow::GetInputMethodContext() { return static_cast(input_method_context_.get()); } -- cgit v1.2.3