Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
Select Case m.Msg
Case WM_QUERYENDSESSION
m.Result = CType(WM_TRUE, IntPtr)
Return
Case WM_POWERBROADCAST
If m.WParam = CType(PBT_APMQUERYSUSPEND, IntPtr) Then
Me.BusManager.Close()
m.Result = CType(WM_TRUE, IntPtr)
End If
Case Else
End Select
End Sub