View previous topic :: View next topic |
Author |
Message |
jvr
Joined: 19 Nov 2007 Posts: 10
|
Posted: Tue Mar 04, 2008 1:30 pm Post subject: Shutdown messages |
|
|
I cannot capture the messages WM_QUERYENDSESSION and WM_ENDSESSION.
Are they previously captured by DFL?
Code: |
static this()
{
Application.addMessageFilter(new MsgFilterer);
}
|
Code: |
class MsgFilterer : IMessageFilter
{
bool preFilterMessage(inout Message msg)
{
bool ret = false;
if(msg.msg == WM_QUERYENDSESSION)
{
ret = true;
msg.result = TRUE;
}
else if(msg.msg == WM_ENDSESSION)
{
if(msg.wParam != 0)
{
Application.exit();
}
ret = true;
msg.result = FALSE;
}
return(ret);
}
}
|
|
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Tue Mar 04, 2008 3:45 pm Post subject: Re: Shutdown messages |
|
|
DFL shouldn't be affecting it. The problem could be maybe those messages are "sent" rather than "posted". Sent messages go directly to the window proc. |
|
Back to top |
|
|
|