C# – MSN Conversation Window Blocking

using System;

using System.Windows.Forms;

using System.Runtime.InteropServices;

 

namespace MSN_Event_Hooker

    //Blocks the opening of any MSN conversation window

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

            MessengerAPI.Messenger MSN = new MessengerAPI.Messenger();

            MSN.OnIMWindowCreated += new MessengerAPI.DMessengerEvents_OnIMWindowCreatedEventHandler(OnIMWindowCreated);

        }

        void OnIMWindowCreated(object plMWindow)

        {

            MessengerAPI.IMessengerWindow theWindow = (MessengerAPI.IMessengerWindow)plMWindow;

            int wHwnd = theWindow.HWND;

            IntPtr cwHwnd;

            cwHwnd = new IntPtr(wHwnd);

            theWindow.Close();

        }

    }

}

 

1 comment so far

  1. Programmer on

    Cool program! Though this program those pop-up windows will be blocked. I never thought that the source for window blocking is too short and simple. I used to program using java, C++ and C. I’m not that good in C# but as i can see, C# has more features and functionalities than the programming language that used to program.


Leave a reply