From 977c766e2337fea238804b8d8b97659361391ed0 Mon Sep 17 00:00:00 2001 From: crupest Date: Mon, 24 Sep 2018 00:16:53 +0800 Subject: Develop basic function of textbox. --- CruUI/application.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'CruUI/application.cpp') diff --git a/CruUI/application.cpp b/CruUI/application.cpp index 2d949edb..af38116f 100644 --- a/CruUI/application.cpp +++ b/CruUI/application.cpp @@ -105,7 +105,11 @@ namespace cru { debug_border_brush_ = graph::CreateSolidBrush(D2D1::ColorF(D2D1::ColorF::Crimson)); #endif - caret_blink_duration_ = std::chrono::milliseconds(::GetCaretBlinkTime()); + caret_info_.caret_blink_duration = std::chrono::milliseconds(::GetCaretBlinkTime()); + DWORD caret_width; + if (!::SystemParametersInfoW(SPI_GETCARETWIDTH, 0 , &caret_width, 0)) + throw Win32Error(::GetLastError(), "Failed to get system caret width."); + caret_info_.half_caret_width = caret_width / 2.0f; } Application::~Application() -- cgit v1.2.3