This page shows the posts published with the category 'WPF'

Prevent Windows shutdown or session ending in .NET

When the user logs off or when he stops his machine, Windows quits all open applications. Some applications want to execute code before ending in order not to lose the current state (a document being written for example). For this Windows sends a message to all applications: WM_QUERYENDSESSION when closing the session WM_ENDSESSION when shutting down the machine If the application does not process these… [read more]