aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-01-29 18:25:02 +0800
committercrupest <crupest@outlook.com>2022-01-29 18:25:02 +0800
commit90261a333f251cc241f186f0ee6ed8e12787cc02 (patch)
tree7b308191503b5961710b9df820e746e421ec9468 /src
parent406d1d2be02e83f897b65789897d81a060142ace (diff)
downloadcru-90261a333f251cc241f186f0ee6ed8e12787cc02.tar.gz
cru-90261a333f251cc241f186f0ee6ed8e12787cc02.tar.bz2
cru-90261a333f251cc241f186f0ee6ed8e12787cc02.zip
...
Diffstat (limited to 'src')
-rw-r--r--src/win/gui/Window.cpp12
1 files changed, 12 insertions, 0 deletions
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<graphics::win::direct::D2DWindowRenderTarget>(
application_->GetDirectFactory(), hwnd_);