Exemplo n.º 1
0
        /// <summary>
        /// Hook callback to process <see cref="Win32Interop.Enums.WM.WM_MOUSEMOVE" /> messages to highlight/un-highlight the close button on each tab
        /// </summary>
        /// <param name="nCode">The message being received</param>
        /// <param name="wParam">Additional information about the message</param>
        /// <param name="lParam">Additional information about the message</param>
        /// <returns>A zero value if the procedure processes the message; a nonzero value if the procedure ignores the message</returns>
        private IntPtr MouseHookCallBack(int nCode, IntPtr wParam, IntPtr lParam)
        {
            MouseEvent mouseEvent = new MouseEvent();

            mouseEvent.nCode  = nCode;
            mouseEvent.wParam = wParam;
            mouseEvent.lParam = lParam;
            if (nCode >= 0 && (int)WM.WM_MOUSEMOVE == (int)wParam)
            {
                mouseEvent.MouseData = (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT));
            }
            MouseEvents.Add(mouseEvent);
            return(User32.CallNextHookEx(HookID, nCode, wParam, lParam));
        }