Cylix,
Use this code & it will do what you need:
' Exit Windows message
Private Shared WM_QUERYENDSESSION As Integer = &H11
#Region "Window Proc (SUB)"
<System.Security.Permissions.PermissionSetAttribut e(System.Security.Permissi
ons.SecurityAction.Demand, Name:="FullTrust")_
Protected Overrides Sub WndProc(ByRef m As
System.Windows.Forms.Message)
' Listen for operating system messages
If m.Msg = WM_QUERYENDSESSION Then
Application.Exit()
End If
' Handle the message
MyBase.WndProc(m)
End Sub
#End Region
I hope this helps,
--
Newbie Coder
(It's just a name)
"Ray Cassick" <rc******@enterprocity.comwrote in message
news:eo**************@TK2MSFTNGP03.phx.gbl...
Do you have any forms that are hidden at the time? They might be causing
issues.
"Cylix" <cy*******@gmail.comwrote in message
news:11*********************@p77g2000hsh.googlegro ups.com...
Thanks Ray,
I have tried to comment the form closing event already, but the
problem still here.
Do you find any solution for this?