Here's code to do each way (I'm bored
). I recommend you use the last one
[list=1][*]Send "/close" to the chat window (not recommended because it shows up in the recent messages list and won't work if commands are disabled)
code:
pChatWnd.SendMessage('/close');
[*]Send a WM_COMMAND message with the menu identifier of the Close menu item
code:
Interop.Call('User32.dll', 'SendMessageW', pChatWnd.Handle, 0x111 /* WM_COMMAND */, 40017, 0);
[*]Send a WM_CLOSE message
code:
Interop.Call('User32.dll', 'SendMessageW', pChatWnd.Handle, 0x0010 /* WM_CLOSE */, 0, 0);
[/list]