Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Supprimer le filtre de message installé

Modifier,ou,créer,une,source,d'événement
{filelink=15688}

using System;
using System.Windows.Forms;
 
public class BloquerMessageFilterSouris : IMessageFilter
{
    const int WM_LBUTTONDOWN = 0x201;
 
    public bool PreFilterMessage(ref Message m)
	{
        if(m.Msg == WM_LBUTTONDOWN)
        {
            Console.WriteLine("Le bouton Gauche de la souris est Appuyé.");
            Application.RemoveMessageFilter(this);
            return true;
        }
        return false;
    }
}
 
public class MonInterface : Form
{
    public static void Main()
    {
        MonInterface MyForm = new MonInterface();
        BloquerMessageFilterSouris MsgFilter = new BloquerMessageFilterSouris();
 
        Application.AddMessageFilter(MsgFilter);
        Application.Run(MyForm);
    }
 
    public MonInterface()
    {
        Text = "Exemple supression Message Filter";
    }
}

No comments yet.

Leave a Comment