Click here to Skip to main content
15,881,852 members
Articles / Programming Languages / XML

Global Windows Hooks

Rate me:
Please Sign up or sign in to vote.
4.80/5 (60 votes)
24 Sep 2010CPOL5 min read 389.8K   11.7K   228  
A single component that contains various Windows hooks
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Diagnostics;

namespace WindowsHookLib
{
    /// <summary>
    /// Provides data for the WindowsHookLib.MouseHook.MouseDown, 
    /// WindowsHookLib.MouseHook.MouseUp, WindowsHookLib.MouseHook.MouseMove 
    /// and WindowsHookLib.MouseHook.MouseWheel events. 
    /// </summary>
    [DebuggerNonUserCode]
    public class MouseEventArgs : System.Windows.Forms.MouseEventArgs
    {
        #region ' Members '

        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
        private bool _mHandled;

        #endregion

        #region ' Properties '

        /// <summary>
        /// Gets or sets a value indicating whether the event was handled.
        /// </summary>
        public bool Handled
        {
            get
            {
                return this._mHandled;
            }
            set
            {
                this._mHandled = value;
            }
        }

        #endregion

        #region ' Methods '

        /// <param name="button">One of the System.Windows.Forms.MouseButtons 
        /// values indicating which mouse button was pressed.</param>
        /// <param name="clicks">The number of times a mouse button was pressed.</param>
        /// <param name="pt">The coordinate point of a mouse click, in pixels.</param>
        /// <param name="delta">A signed count of the number 
        /// of detents the wheel has rotated.</param>
        public MouseEventArgs(MouseButtons button, int clicks, Point pt, int delta) 
            : base(button, clicks, pt.X, pt.Y, delta) { }

        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) ZipEdTech
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions