From 79cd42d7c63bb97f702a52216f6eb841074f961d Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 29 Apr 2013 11:15:14 +0200 Subject: [PATCH] Changed: Added a new event EventCloseWindowId when system reports window should be closed --- code/nel/include/nel/misc/events.h | 14 ++++++++++++++ code/nel/src/misc/win_event_emitter.cpp | 3 +++ 2 files changed, 17 insertions(+) diff --git a/code/nel/include/nel/misc/events.h b/code/nel/include/nel/misc/events.h index 87829926e..e05ef3d2f 100644 --- a/code/nel/include/nel/misc/events.h +++ b/code/nel/include/nel/misc/events.h @@ -65,6 +65,7 @@ const CClassId EventStringId (0x49b5af8f, 0x7f52cd26); const CClassId EventActivateId (0x7da66b0a, 0x1ef74519); const CClassId EventSetFocusId (0x17650fac, 0x19f85dde); const CClassId EventDestroyWindowId (0x69be73fe, 0x4b07603b); +const CClassId EventCloseWindowId (0xb5cb1333, 0xd092e63a); // Mouse events const CClassId EventMouseMoveId (0x3dd12fdb, 0x472f548b); @@ -504,6 +505,19 @@ public: virtual CEvent *clone() const {return new CEventDestroyWindow(*this);} }; +/** + * CEventCloseWindow + */ +class CEventCloseWindow : public CEvent +{ +public: + CEventCloseWindow (IEventEmitter* emitter) : CEvent (emitter, EventCloseWindowId) + { + } + + virtual CEvent *clone() const {return new CEventCloseWindow(*this);} +}; + /** * CEventIME */ diff --git a/code/nel/src/misc/win_event_emitter.cpp b/code/nel/src/misc/win_event_emitter.cpp index b330d7e57..bb43e290b 100644 --- a/code/nel/src/misc/win_event_emitter.cpp +++ b/code/nel/src/misc/win_event_emitter.cpp @@ -281,6 +281,9 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA case WM_DESTROY: server->postEvent (new CEventDestroyWindow (this)); break; + case WM_CLOSE: + server->postEvent (new CEventCloseWindow (this)); + return true; case WM_DISPLAYCHANGE: server->postEvent (new CEventDisplayChange (LOWORD(lParam), HIWORD(lParam), (uint)wParam, this)); break;