Archive for the 'C#.net' Category

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();

        }

    }

}

 

Next Page »