tri_inn

tri_inn

  • NA
  • 1.2k
  • 232.9k

Detect mouse over & out on minimize SDI window form apps c#

May 17 2011 3:25 AM
suppose i have mdi and few sdi form. when sdi form is minimize in mdi window and if i place my mouse on minimize sdi window then how could i detect that mouse is placed on minimize sdi windows or mouse out with c#. please guide me that how could i detect mouse over & out on minimize SDI window in MDI application with c#.

i tried the below code to detect mouse over on minimize window.it is working when i put my mouse on minimize windows title bar. here is my code.

        private static int WM_NCMOUSEMOVE = 0x00A0;
        private static int WM_COMMAND = 0x0112;
        private static int SC_MINIMIZE = 0xf020;


    protected override void WndProc(ref Message m)
        {
            if (m.Msg == WM_COMMAND && m.WParam.ToInt32() == SC_MINIMIZE)
            {
                OnMinimize(EventArgs.Empty);
            }
            else if (m.Msg == WM_NCMOUSEMOVE)
            {
                int x = m.LParam.ToInt32() & 0x0000ffff;
                int y = m.LParam.ToInt32() >> 16;
                OnNcMouseMove(new MouseEventArgs(MouseButtons.None, 0, x, y, 0));
            }
            base.WndProc(ref m);
        }

but the i want to know how could i detect when mouse is out from the minimize window. please guide me with sample code.

Answers (3)