]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Remove notification icon if log console window is force closed.
authorToni Wilen <twilen@winuae.net>
Tue, 21 Jun 2016 13:20:15 +0000 (16:20 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 21 Jun 2016 13:20:15 +0000 (16:20 +0300)
od-win32/writelog.cpp

index f57bf1e54c11f9b686c80fd25f588da58b5e3633..b34952d43f53500c02396947a8bebf0849199de3 100644 (file)
@@ -90,6 +90,14 @@ static void set_console_input_mode(int line)
        console_input_linemode = line;
 }
 
+static BOOL WINAPI ctrlchandler(DWORD ct)
+{
+       if (ct == CTRL_C_EVENT || ct == CTRL_CLOSE_EVENT) {
+               systray(hHiddenWnd, TRUE);
+       }
+       return FALSE;
+}
+
 static void getconsole (void)
 {
        CONSOLE_SCREEN_BUFFER_INFO csbi;
@@ -106,6 +114,7 @@ static void getconsole (void)
                        SetConsoleScreenBufferSize (stdoutput, csbi.dwMaximumWindowSize);
                }
        }
+       SetConsoleCtrlHandler(ctrlchandler, TRUE);
 }
 
 static void flushmsgpump(void)