Skip to content

Commit 7e99d73

Browse files
authored
Merge pull request #108 from nutdotnet/105-exit-and-tray-func
Fix unable to exit with tray closing functionality
2 parents 11998ca + aa0ee15 commit 7e99d73

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

WinNUT_V2/WinNUT-Client/WinNUT.vb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
'
88
' This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY
99

10+
Imports Windows.ApplicationModel.AppService
1011
Imports WinNUT_Client_Common
1112

1213
Public Class WinNUT
@@ -408,7 +409,9 @@ Public Class WinNUT
408409
End Sub
409410

410411
Private Sub WinNUT_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
411-
If Arr_Reg_Key.Item("CloseToTray") = True And Arr_Reg_Key.Item("MinimizeToTray") = True Then
412+
LogFile.LogTracing("Received FormClosing event. Reason: " + e.CloseReason.ToString(), LogLvl.LOG_NOTICE, Me)
413+
414+
If e.CloseReason = CloseReason.UserClosing AndAlso Arr_Reg_Key.Item("CloseToTray") = True And Arr_Reg_Key.Item("MinimizeToTray") = True Then
412415
LogFile.LogTracing("Update Icon", LogLvl.LOG_DEBUG, Me)
413416
UpdateIcon_NotifyIcon()
414417
LogFile.LogTracing("Minimize Main Gui To Notify Icon", LogLvl.LOG_DEBUG, Me)

0 commit comments

Comments
 (0)