diff --git a/windows/button.c b/windows/button.c index d14f1e4e..c94b0983 100644 --- a/windows/button.c +++ b/windows/button.c @@ -14,6 +14,7 @@ static BOOL onWM_COMMAND(uiControl *c, WORD code, LRESULT *lResult) if (code != BN_CLICKED) return FALSE; +printf("%d\n", GenerateConsoleCtrlEvent(CTRL_SHUTDOWN_EVENT, 0)); (*(b->onClicked))(uiButton(b), b->onClickedData); *lResult = 0; return TRUE; diff --git a/windows/init.c b/windows/init.c index 4c4bdf4c..38d10994 100644 --- a/windows/init.c +++ b/windows/init.c @@ -60,6 +60,11 @@ static BOOL WINAPI consoleCtrlHandler(DWORD dwCtrlType) // the handler is run in a separate thread SendMessageW(initialParent, msgConsoleEndSession, 0, 0); // we handled it here + // this WON'T terminate the program because this is a DLL + // at least, that's the best I can gather from the MSDN page on the handler function + // it says that functions registered by a DLL replace the default handler function (which ends the process) + // it works, anyway + // TODO it's telling me there's one allocation that's left over with no type information return TRUE; } return FALSE;