Welcome to AddressOf.com Sign in | Join | Help

Console Event Handling

Someone sent me an IM asking if I knew of a way to handle the pressing of the close button on a console application.  After a bit of research, I found a way (and some limitations).  This required stepping outside of the Microsoft .NET Framework utilizing P/Invoke.  This allowed me to capture the application close event (which is initiated via the close button, the close menu item or task manager) and when Windows is shutting down (the user logging off).  You can read all about how to accomplish this here.

Published Monday, July 23, 2007 9:19 PM by CorySmith
Filed under: , ,


# University Update - Microsoft .Net - Console Event Handling

Anonymous comments are disabled