From 82f42a4103c168abd3605acad8ee4b9b4f00d79d Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 23 Sep 2018 21:00:46 +0800 Subject: Add native message handler event in Window. --- CruUI/ui/window.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'CruUI/ui/window.cpp') diff --git a/CruUI/ui/window.cpp b/CruUI/ui/window.cpp index b20abb61..6ff962b6 100644 --- a/CruUI/ui/window.cpp +++ b/CruUI/ui/window.cpp @@ -82,7 +82,7 @@ namespace cru Vector windows; for (auto [key, value] : window_map_) windows.push_back(value); - return std::move(windows); + return windows; } inline Point PiToDip(const POINT& pi_point) @@ -201,6 +201,19 @@ namespace cru } bool Window::HandleWindowMessage(HWND hwnd, int msg, WPARAM w_param, LPARAM l_param, LRESULT & result) { + + if (!native_message_event.IsNoHandler()) + { + const events::WindowNativeMessage message{hwnd, msg, w_param, l_param}; + events::WindowNativeMessageEventArgs args(this, this, message); + native_message_event.Raise(args); + if (args.GetResult().has_value()) + { + result = args.GetResult().value(); + return true; + } + } + switch (msg) { case WM_PAINT: OnPaintInternal(); -- cgit v1.2.3