mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-08 06:31:50 +08:00
Added Ctrl-C handling for issue 479
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user