Emit("app-command", command_name);
}
+#if defined(OS_WIN)
+void Window::OnWindowMessage(UINT message, LPARAM l_param, WPARAM w_param) {
+ Emit("message", message, l_param, w_param);
+}
+#endif
+
// static
mate::Wrappable* Window::New(v8::Isolate* isolate,
const mate::Dictionary& options) {
void OnRendererResponsive() override;
void OnExecuteWindowsCommand(const std::string& command_name) override;
+ #if defined(OS_WIN)
+ void OnWindowMessage(unsigned int message, LPARAM l_param,
+ WPARAM w_param) override;
+ #endif
+
// mate::Wrappable:
bool IsDestroyed() const override;
OnExecuteWindowsCommand(command));
}
+#if defined(OS_WIN)
+void NativeWindow::NotifyWindowMessage(UINT message, WPARAM w_param,
+ LPARAM l_param) {
+ FOR_EACH_OBSERVER(NativeWindowObserver, observers_,
+ OnWindowMessage(message, w_param, l_param));
+}
+#endif
+
scoped_ptr<SkRegion> NativeWindow::DraggableRegionsToSkRegion(
const std::vector<DraggableRegion>& regions) {
scoped_ptr<SkRegion> sk_region(new SkRegion);
void NotifyWindowLeaveHtmlFullScreen();
void NotifyWindowExecuteWindowsCommand(const std::string& command);
+ #if defined(OS_WIN)
+ void NotifyWindowMessage(UINT message, WPARAM w_param, LPARAM l_param);
+ #endif
+
void AddObserver(NativeWindowObserver* obs) {
observers_.AddObserver(obs);
}
#include "ui/base/window_open_disposition.h"
#include "url/gurl.h"
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
namespace atom {
class NativeWindowObserver {
virtual void OnWindowEnterHtmlFullScreen() {}
virtual void OnWindowLeaveHtmlFullScreen() {}
+ // Called when window message received
+ #if defined(OS_WIN)
+ virtual void OnWindowMessage(UINT message, LPARAM l_param, WPARAM w_param) {}
+ #endif
+
// Called when renderer is hung.
virtual void OnRendererUnresponsive() {}
bool NativeWindowViews::PreHandleMSG(
UINT message, WPARAM w_param, LPARAM l_param, LRESULT* result) {
+ NotifyWindowMessage(message, w_param, l_param);
+
switch (message) {
case WM_COMMAND:
// Handle thumbar button click message.
Emitted when the window leaves full screen state triggered by html api.
+### Event: 'message' _WINDOWS_
+
+Emitted when the window receives a message from the operating system.
+
### Event: 'app-command':
Emitted when an [App Command](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646275(v=vs.85).aspx)