diff options
author | crupest <crupest@outlook.com> | 2022-01-29 18:25:02 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-01-29 18:25:02 +0800 |
commit | 90261a333f251cc241f186f0ee6ed8e12787cc02 (patch) | |
tree | 7b308191503b5961710b9df820e746e421ec9468 /src | |
parent | 406d1d2be02e83f897b65789897d81a060142ace (diff) | |
download | cru-90261a333f251cc241f186f0ee6ed8e12787cc02.tar.gz cru-90261a333f251cc241f186f0ee6ed8e12787cc02.tar.bz2 cru-90261a333f251cc241f186f0ee6ed8e12787cc02.zip |
...
Diffstat (limited to 'src')
-rw-r--r-- | src/win/gui/Window.cpp | 12 |
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_); |