© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
59 replies
Ossie

❔ Execute code on WPF program close

Hi, is there a way I can execute some code every single time the application closes. Either if it crashes, is closed manually, the computer restarts, or closed thru task manager or whatever?

For WPF
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Next page

Similar Threads

❔ Execute code when console app is closed on Windows?
C#CC# / help
4y ago
❔ WPF not disposing of memory on window close
C#CC# / help
3y ago
✅ Why this insta close program
C#CC# / help
3y ago
❔ Why does this program close?
C#CC# / help
3y ago