Force application close on system shutdown

前端 未结 5 1564
臣服心动
臣服心动 2020-12-29 22:18

I have a Windows Forms application that when the Main Window is closing, it displays a basic dialog box, confirming the action. If the user decides to cancel the application

5条回答
  •  情话喂你
    2020-12-29 22:22

    you can use Application.SessionEnding Event to understand if the system is about to shutdown

    http://msdn.microsoft.com/en-us/library/system.windows.application.sessionending.aspx

提交回复
热议问题