Click here to Skip to main content
11,438,069 members (50,161 online)
Click here to Skip to main content
Articles » Languages » C# » General » Downloads
Add your own
alternative version

A Simple C# Global Low Level Keyboard Hook

, 30 May 2007 CPOL
A simple description and sample of creating a global low level keyboard hook in C#
key_preview.zip
key preview
key preview
bin
Release
key preview sample.zip
key preview.exe
key preview.pdb
key preview.vshost.exe
Properties
Settings.settings
key preview.suo
key_preview_sample.zip
key preview.exe
namespace key_preview {
	partial class Form1 {
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing) {
			if (disposing && (components != null)) {
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Windows Form Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent() {
			this.lstLog = new System.Windows.Forms.ListBox();
			this.SuspendLayout();
			// 
			// lstLog
			// 
			this.lstLog.Dock = System.Windows.Forms.DockStyle.Fill;
			this.lstLog.FormattingEnabled = true;
			this.lstLog.Location = new System.Drawing.Point(0, 0);
			this.lstLog.Name = "lstLog";
			this.lstLog.Size = new System.Drawing.Size(292, 264);
			this.lstLog.TabIndex = 0;
			// 
			// Form1
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(292, 266);
			this.Controls.Add(this.lstLog);
			this.KeyPreview = true;
			this.Name = "Form1";
			this.Text = "Form1";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.ResumeLayout(false);

		}

		#endregion

		private System.Windows.Forms.ListBox lstLog;
	}
}

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

StormySpike
Software Developer
United States United States
I currently work as a Software Engineer for a company in North Carolina, mainly working with C#.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150506.1 | Last Updated 30 May 2007
Article Copyright 2007 by StormySpike
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid