There isn't a way to iterate through the opened conversations. Basically what your doing there is blocking every single contact on your list. As well the .Blocked property accepts booleans (true/false) not strings. So it would be
code:
var e = new Enumerator(Messenger.MyContacts);
for(; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
Contact.Blocked = true;
}
Cheap way to do it would be to enum all the IMWindowClass windows store their handles in an array, then for each contact open a chat window and check if the handle existed in the array if it did block them, if it didn't close the window. That is going to be VERY slow but the only way I can see of doing it.
I just noticed the ChatWnds Object.
code:
Debug.Trace("Currently opened chat windows:");
var Windows = Messenger.CurrentChats;
var e = new Enumerator(Windows);
for(; !e.atEnd(); e.moveNext())
{
var ChatWindow = e.item();
Debug.Trace(" Handle: " + ChatWindow.Handle);
}
So iterate through the chat windows and instead of tracing the handle, have another function to iterate through ChatWindow.Contacts.
[offtopic]
Anyone ever have out of body experiences? Like you feel like your not actually where you are, right now as I am typing this it feels like I am behind myself looking down.
[/offtopic]