From 90261a333f251cc241f186f0ee6ed8e12787cc02 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 29 Jan 2022 18:25:02 +0800 Subject: ... --- src/win/gui/Window.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/win/gui/Window.cpp b/src/win/gui/Window.cpp index b3cf7065..2bd29476 100644 --- a/src/win/gui/Window.cpp +++ b/src/win/gui/Window.cpp @@ -87,6 +87,16 @@ void WinNativeWindow::SetParent(INativeWindow* parent) { } } +String WinNativeWindow::GetTitle() { return title_; } + +void WinNativeWindow::SetTitle(String title) { + title_ = title; + + if (hwnd_) { + ::SetWindowTextW(hwnd_, title_.WinCStr()); + } +} + void WinNativeWindow::SetStyleFlag(WindowStyleFlag flag) { if (flag == style_flag_) return; @@ -466,6 +476,8 @@ void WinNativeWindow::RecreateWindow() { SetCursor(application_->GetCursorManager()->GetSystemCursor( cru::platform::gui::SystemCursorType::Arrow)); + ::SetWindowTextW(hwnd_, title_.WinCStr()); + window_render_target_ = std::make_unique( application_->GetDirectFactory(), hwnd_); -- cgit v1.2.3