code:var oChatWnd = Messenger.OpenChat("johndoe@hotmail.com"); Interop.Call("user32", "SendMessageW", oChatWnd.Handle, 0x10 /*WM_CLOSE*/, 0,0);