Пример #1
0
        void IWndProcProvider.WndProc(ref Message msg, ToolTipNativeWindow wnd)
        {
            switch ((WindowsMessages)msg.Msg)
            {
            case WindowsMessages.WM_PAINT:
                PaintToolTip(ref msg);
                break;

            case WindowsMessages.WM_MOUSELEAVE:
                m_bTrackingMouseLeave = false;
                {
                    IntPtr pMouseLoc;
                    pMouseLoc = GCHandle.ToIntPtr(GCHandle.Alloc(Control.MousePosition, GCHandleType.Normal));

                    Win32.PostMessage(m_Parent.Handle, (uint)DatalistMessage.WM_TOOLTIPMOUSEMOVE, IntPtr.Zero, pMouseLoc);
                }
                break;

            case WindowsMessages.WM_MOUSEMOVE:
                if (!m_bTrackingMouseLeave)
                {
                    StartMouseLeaveTracking();
                }
                {
                    IntPtr pMouseLoc;
                    pMouseLoc = GCHandle.ToIntPtr(GCHandle.Alloc(Control.MousePosition, GCHandleType.Normal));

                    Win32.PostMessage(m_Parent.Handle, (uint)DatalistMessage.WM_TOOLTIPMOUSEMOVE, IntPtr.Zero, pMouseLoc);
                }
                break;

            case WindowsMessages.WM_MOUSEACTIVATE:
                msg.Result = new IntPtr((int)MouseActivate.MA_NOACTIVATE);
                break;

            case WindowsMessages.WM_MOUSEWHEEL:
            case WindowsMessages.WM_RBUTTONUP:
            case WindowsMessages.WM_LBUTTONUP:
            case WindowsMessages.WM_RBUTTONDOWN:
            case WindowsMessages.WM_LBUTTONDOWN:
                HideToolTip(true);
                Win32.mouse_event((uint)GetMouseEventMessage((WindowsMessages)msg.Msg), 0, 0, 0, 0);
                break;

            default:
                wnd.DefWndProc(ref msg);
                break;
            }
        }
Пример #2
0
        public CellToolTip(ListWnd parent)
        {
            m_Parent = parent;

            m_bDisposed  = false;
            m_ToolTipWnd = new ToolTipNativeWindow(this);

            m_Visible = false;

            m_ShowTimer = new Timer();
            m_ShowTimer.Stop();
            m_ShowTimer.Interval = SystemInformation.DoubleClickTime + 200;

            CreateToolTipWnd();

            m_ShowTimer.Tick += new EventHandler(m_ShowTimer_Tick);

            m_bTrackingMouseLeave = false;
        }