I have an application in which if I close it using a button with the following code closes properly.

Private Sub exit_Click()

Dim sMsg As String
Dim nButtons As Integer
Dim nResult As Integer
'
sMsg = "Are you sure you want to exit?"
nButtons = vbYesNo + vbQuestion
nResult = MsgBox(sMsg, nButtons, APP_Title$)
'
If nResult = vbYes Then
'
End
'
End If
'
g_exit_pressed = False

End Sub

If I close it using the X in the corner of the window then check NT Task manager, the program is still running.

Anyone Help????

Thanks

Neil