﻿using System;
using System.Windows.Forms;

namespace MessageFilter
{
	class MessageFilter : IMessageFilter
	{
		public bool PreFilterMessage(ref Message m)
		{
			if (m.Msg == 0xF || m.Msg == 0x113 || m.Msg == 0x200 || m.Msg == 0xA0)	// 0xF=WM_PAINT, 0x113=WM_TIMER, 0x200=WM_MOUSEMOVE, 0xA0=WM_NCMOUSEMOVE
				return false;
			Console.WriteLine("{0} : {1}", m.ToString(), m.Msg);
			return true;
		}
	}

	class MainApp : Form
	{
		static void Main(string[] args)
		{
			MainApp form = new MainApp();
			Application.AddMessageFilter(new MessageFilter());
			Application.Run(form);
		}
	}
}