Changed: Added a new event EventCloseWindowId when system reports window should be closed

This commit is contained in:
kervala 2013-04-29 11:15:14 +02:00
parent b7906ed835
commit 79cd42d7c6
2 changed files with 17 additions and 0 deletions

View file

@ -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
*/

View file

@ -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;