aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-12-21 04:42:43 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-12-21 04:42:43 +0000
commit7ee61ac93843da9fc485a5b67fdacba2063523fc (patch)
tree78ba4a6e9aa6261067bd34783b473c47d7a0ed11 /src
parent18dff216d322665e02f68e810d1beaff4e4020d1 (diff)
win32: call app_will_exit() when WM_ENDSESSION is received.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1932 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index a29dd44a..c0c35350 100644
--- a/src/main.c
+++ b/src/main.c
@@ -970,7 +970,8 @@ static void set_log_handlers(gboolean enable)
static LRESULT CALLBACK
wndproc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
{
- if (message == WM_POWERBROADCAST) {
+ switch (message) {
+ case WM_POWERBROADCAST:
debug_print("WM_POWERBROADCAST received: wparam = %d\n",
wparam);
if (wparam == PBT_APMSUSPEND || wparam == PBT_APMSTANDBY) {
@@ -981,6 +982,15 @@ wndproc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam)
debug_print("resume now\n");
inc_autocheck_timer_set();
}
+ break;
+ case WM_ENDSESSION:
+ if (wparam == 1) {
+ log_print("WM_ENDSESSION received: system is quitting\n");
+ app_will_exit(TRUE);
+ }
+ break;
+ default:
+ break;
}
return DefWindowProc(hwnd, message, wparam, lparam);