More commentary and TODOs about the previous commit(s).

This commit is contained in:
Pietro Gagliardi 2015-05-09 16:04:54 -04:00
parent bd4716c949
commit 349d54b2f1
2 changed files with 6 additions and 0 deletions

View File

@ -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;

View File

@ -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;