using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OdbieranieKomunikatow
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private const int WM_NCMOUSEMOVE = 0x00A0;

        protected override void WndProc(ref Message m)
        {
            if (m.Msg != 308) listBox1.Items.Add(m.Msg);

            switch (m.Msg)
            {
                case WM_NCMOUSEMOVE:
                    long lParam = (long)m.LParam;
                    long x = lParam & 0x0000FFFF;
                    long y = (lParam & 0xFFFF0000) >> 16;
                    toolStripStatusLabel1.Text = "(Komunikat) Mysz poza obszarem klienta: " + x + "," + y;
                    break;
            }

            base.WndProc(ref m);
        }        
    }
}
