Only one problem, if you have conversation windows open it wont shut down, it will ask if you wish to close them first.
This is the code I used to close all of the IM Windows, do this before doing the graceful and forceful shutdowns on MSN
code:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Public Const WM_CLOSE = &H10
Public Function closeAll()
Dim imwindowclass As Long
10 imwindowclass = FindWindow("imwindowclass", vbNullString)
If imwindowclass <> 0 Then
Call SendMessageLong(imwindowclass, WM_CLOSE, 0&, 0&)
GoTo 10
Else: Exit Function
End If
End Function