how am i to save a list class using this isee no way to pass the class object or make the handler a member of the class i also can seem to find where the handler returns to also dtors dont hit on x button exits
//list l;
if (SetConsoleCtrlHandler( (PHANDLER_ROUTINE)ConsoleHandler,TRUE)==FALSE)
{
// unable to install handler...
// display message to the user
printf("Unable to install handler!\n")
Sorry that I am a bit late in seeing this. You are already setting the Callback with the "SetConsoleCtrlHandler()" function and passing it a pointer to the function you wrote. This basically makes your function a member of the class for the console window. This function won't return to your program, it's for handling Windows Messages that are sent to the console.