Fixed prevent shutdown while minimized bug with issue #77

This commit is contained in:
MikeMaximus
2017-06-28 11:50:50 -06:00
parent 9386da4a2a
commit ef6997a2ab
+15 -10
View File
@@ -1649,16 +1649,21 @@ Public Class frmMain
ShutdownApp() ShutdownApp()
End If End If
'Intercept Exit Select Case e.CloseReason
If bShutdown = False Then Case CloseReason.UserClosing
e.Cancel = True If bShutdown = False Then
If Not mgrCommon.IsUnix Then e.Cancel = True
bShowToggle = False If Not mgrCommon.IsUnix Then
wState = Me.WindowState bShowToggle = False
Me.WindowState = FormWindowState.Minimized wState = Me.WindowState
Me.ShowInTaskbar = False Me.WindowState = FormWindowState.Minimized
End If Me.ShowInTaskbar = False
End If End If
End If
Case CloseReason.TaskManagerClosing, CloseReason.WindowsShutDown
'Do nothing and let the app close without warning
End Select
End Sub End Sub
Private Sub AutoRestoreEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmRestoreCheck.Elapsed Private Sub AutoRestoreEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmRestoreCheck.Elapsed