diff options
author | Yuqian Yang <crupest@outlook.com> | 2018-09-23 13:03:18 +0000 |
---|---|---|
committer | Yuqian Yang <crupest@outlook.com> | 2018-09-23 13:03:18 +0000 |
commit | 796ba6e1e816ec87a106f2f7b501e38c99f059e1 (patch) | |
tree | 6db4f99f3dc2f85fba3f8339da53849d04a5cfee /CruUI/ui/window.cpp | |
parent | ad8ea7fc26b3e0807d11965d93c26a6ff51db226 (diff) | |
parent | 82f42a4103c168abd3605acad8ee4b9b4f00d79d (diff) | |
download | cru-796ba6e1e816ec87a106f2f7b501e38c99f059e1.tar.gz cru-796ba6e1e816ec87a106f2f7b501e38c99f059e1.tar.bz2 cru-796ba6e1e816ec87a106f2f7b501e38c99f059e1.zip |
Merge branch 'native_message_handler' into 'master'
Window native message event.
See merge request crupest/CruUI!1
Diffstat (limited to 'CruUI/ui/window.cpp')
-rw-r--r-- | CruUI/ui/window.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
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<Window*> 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(); |