Question : hide in form closing....can not shut down

I have a windows app running on XP. I keep the app running in the background when the user closes the form by using the following code:
Private Sub DataBaseBackup_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        e.Cancel = True
        Me.Hide()
    End Sub

It works good except  the computer does not shut down.  I am guessing that widows is trying to close the app but it keeps hiding.  Is there a way to close the form is windows is shutting down?
Thanks

Answer : hide in form closing....can not shut down

Here is another method that prevents the Form from being closed with the 'X' button...but still allows it to be shuthdown gracefully:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
Public Class Form1
 
    Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
        Const SC_CLOSE As Integer = &HF060
        Const WM_SYSCOMMAND As Integer = &H112
 
        Select Case m.Msg
            Case WM_SYSCOMMAND
                Select Case m.WParam.ToInt32
                    Case SC_CLOSE
                        ' The close button "X" was clicked
                        Me.Hide()
                        Exit Sub ' suppress default action
 
                End Select
        End Select
 
        MyBase.WndProc(m)
    End Sub
 
End Class
Random Solutions  
 
programming4us programming4us