handle user logoff or machine shutdown requests on WindowsME

Posted by skylap on Stack Overflow See other posts from Stack Overflow or by skylap
Published on 2010-04-14T20:28:42Z Indexed on 2010/04/14 20:53 UTC
Read the original article Hit count: 289

Filed under:
|
|

I have to write a C# application that runs on WindowsME. Yes, I mean that Microsoft operating system that has been forgotten a long long time ago. My program needs no user interaction and as WindowsME doesn't support services, it will be a console application. Furthermore it will be used on more modern operating systems, where the user can choose whether to start it as console application or install it as a windows service. Now suppose the software is running on WinME and the user decides to logoff or shutdown the machine without a prior quit of my software. WinME complains about my program still running and asks if it should kill the process. Apart from the bad user experiance, this means that the application is not shut down properly.

So I look for a way to be informed if the user logs off or wants to shutdown the machine to be able to perform a proper shutdown of my software first.

© Stack Overflow or respective owner

Related posts about c#

Related posts about logout