mirror of
https://github.com/debauchee/barrier.git
synced 2025-06-16 01:31:42 +02:00
Added Ctrl-C handling for issue 479
This commit is contained in:
parent
60a428443e
commit
7842596748
8 changed files with 36 additions and 1 deletions
|
@ -21,6 +21,7 @@
|
|||
#include "LogOutputters.h"
|
||||
#include "CMSWindowsScreen.h"
|
||||
#include "XSynergy.h"
|
||||
#include "IArchTaskBarReceiver.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
@ -29,12 +30,27 @@
|
|||
CArchAppUtilWindows::CArchAppUtilWindows() :
|
||||
m_exitMode(kExitModeNormal)
|
||||
{
|
||||
if (SetConsoleCtrlHandler((PHANDLER_ROUTINE)consoleHandler, TRUE) == FALSE)
|
||||
{
|
||||
throw XArchEvalWindows();
|
||||
}
|
||||
}
|
||||
|
||||
CArchAppUtilWindows::~CArchAppUtilWindows()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL WINAPI CArchAppUtilWindows::consoleHandler(DWORD CEvent)
|
||||
{
|
||||
// HACK: it would be nice to delete the s_taskBarReceiver object, but
|
||||
// this is best done by the CApp destructor; however i don't feel like
|
||||
// opening up that can of worms today... i need sleep.
|
||||
instance().app().s_taskBarReceiver->cleanup();
|
||||
|
||||
ExitProcess(kExitTerminated);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool
|
||||
CArchAppUtilWindows::parseArg(const int& argc, const char* const* argv, int& i)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue