Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Global Windows Hooks

, 24 Sep 2010 CPOL
A single component that contains various Windows hooks
Library_Files.zip
Library Files
WindowsHookLib.dll
Source_Code_and_Demo.zip
Source Code and Demo
WindowsHookDemo
WindowsHookDemo.suo
WindowsHookDemo
bin
Debug
WindowsHookDemo.exe
WindowsHookDemo.vshost.exe
WindowsHookLib.dll
Release
My Project
Application.myapp
Settings.settings
WindowsHookDemo.vbproj.user
WindowsHookLib
WindowsHookLib.suo
WindowsHookLib
bin
Release
x86
Release
WindowsHookLib.dll
WindowsHookLib.dll.lastcodeanalysissucceeded
WindowsHookLib.pdb
Properties
Resources
clipboard.ico
keyboard.ico
mouse.ico
Thumbs.db
WindowsHookLib_Component.zip
WindowsHookLib Component
WindowsHookLib.dll
using System.Windows.Forms;
using System.Diagnostics;
using System.ComponentModel;

namespace WindowsHookLib
{
    /// <summary>
    /// Provides data for the WindowsHookLib.KeyboardHook.KeyDown and 
    /// WindowsHookLib.KeyboardHook.KeyUp events. 
    /// </summary>
    [DebuggerNonUserCode]
    public class KeyboardEventArgs : System.Windows.Forms.KeyEventArgs
    {
        #region ' Members '

        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
        private Keys _vkCode;

        #endregion

        #region ' Properties '

        /// <summary>
        /// Gets or sets a value indicating whether the event was handled.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never),
        DebuggerBrowsable(DebuggerBrowsableState.Never)]
        new public bool SuppressKeyPress
        {
            get
            {
                return base.SuppressKeyPress;
            }
            set
            {
                base.SuppressKeyPress = value;
            }
        }

        /// <summary>
        /// Gets the virtual key code for a KeyDown or KeyUp event.
        /// </summary>
        public Keys VirtualKeyCode
        {
            get
            {
                return this._vkCode;
            }
        }

        #endregion

        #region ' Methods '

        /// <param name="keyData">A System.Windows.Forms.Keys representing 
        /// the key that was pressed, combined with any modifier flags that 
        /// indicate which CTRL, SHIFT, and ALT keys were pressed at the same time. 
        /// Possible values are obtained by applying bitwise OR (|) operator 
        /// to constants from the System.Windows.Forms.Keys enumeration.</param>
        /// <param name="virtualKeyCode">The virtual key code.</param>
        public KeyboardEventArgs(Keys keyData, Keys virtualKeyCode)
            : base(keyData)
        {
            this._vkCode = virtualKeyCode;
        }

        #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)

Share

About the Author

VBDT
Software Developer (Senior) ZipEdTech
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 24 Sep 2010
Article Copyright 2007 by VBDT
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid