aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/window.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-23 21:00:46 +0800
committercrupest <crupest@outlook.com>2018-09-23 21:00:46 +0800
commit82f42a4103c168abd3605acad8ee4b9b4f00d79d (patch)
tree6db4f99f3dc2f85fba3f8339da53849d04a5cfee /CruUI/ui/window.cpp
parentad8ea7fc26b3e0807d11965d93c26a6ff51db226 (diff)
downloadcru-82f42a4103c168abd3605acad8ee4b9b4f00d79d.tar.gz
cru-82f42a4103c168abd3605acad8ee4b9b4f00d79d.tar.bz2
cru-82f42a4103c168abd3605acad8ee4b9b4f00d79d.zip
Add native message handler event in Window.
Diffstat (limited to 'CruUI/ui/window.cpp')
-rw-r--r--CruUI/ui/window.cpp15
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();