Hello, I developed an application to the msn messenger in C # to monitor and control the company in msn. the problem is that after being updated for 2011 msn my application no longer works!
The event msn_OnIMWindowCreated no longer works ....

Can anyone help me? : |

I can not find the corresponding event in the api. could you help me?

    private void msn_OnIMWindowDestroyed(object pIMWindow)
    {
        if (!globalStatus)
        {
            return;
        }

        if (!cfgSettings.LogConversations)
        {
            return;
        }

        try
        {
            //MessengerAPI.IMessengerConversationWnd imWindow = (MessengerAPI.IMessengerConversationWnd)pIMWindow;
            MessengerAPI.IMSNMessengerConversationWnd imWindow = (MessengerAPI.IMSNMessengerConversationWnd)pIMWindow;

            //MessengerAPI.IMessengerContacts contacts = (MessengerAPI.IMessengerContacts)imWindow.Contacts;
            MessengerAPI.IMSNMessengerContacts contacts = (MessengerAPI.IMSNMessengerContacts)imWindow.Contacts;

            string contactName = string.Empty;

            //foreach (MessengerAPI.IMessengerContact contact in contacts)
            foreach (MessengerAPI.IMSNMessengerContact contact in contacts)
            {
                contactName = contact.FriendlyName + ";";
            }

            if (imWindow.History != null)
            {
                string history = imWindow.History;

                SaveHistory(history, contactName, imWindow.HWND);
            }

            openedWindows.Remove(imWindow.HWND);
        }
        catch
        {
        }
        finally
        {
        }
    }

    private void msn_OnIMWindowCreated(object pIMWindow)
    {
        if (!globalStatus)
        {
            return;
        }

        if (!cfgSettings.LogConversations)
        {
            return;
        }

        try
        {
            //MessengerAPI.IMessengerConversationWnd imWindow = (MessengerAPI.IMessengerConversationWnd)pIMWindow;
            MessengerAPI.IMSNMessengerConversationWnd imWindow = (MessengerAPI.IMSNMessengerConversationWnd)pIMWindow;
            //MessengerAPI.IMessengerContacts contacts = (MessengerAPI.IMessengerContacts)imWindow.Contacts;
            MessengerAPI.IMSNMessengerContacts contacts = (MessengerAPI.IMSNMessengerContacts)imWindow.Contacts;

            string contactName = string.Empty;

            //foreach (MessengerAPI.IMessengerContact contact in contacts)
            foreach (MessengerAPI.IMSNMessengerContact contact in contacts)
            {
                contactName = contact.FriendlyName;
            }

            //if (contactName == "Oscar")
            //{
            //    imWindow.Close();
            //    MessageBox.Show("Contacto bloqueado!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //}

            if (!openedWindows.ContainsKey(imWindow.HWND))
            {
                openedWindows.Add(imWindow.HWND, pIMWindow);
            }
        }
        catch
        {
        }
    }

    #endregion Conversations

Edited 3 Years Ago by Dani: Formatting fixed

This article has been dead for over six months. Start a new discussion instead.