Click here to Skip to main content
11,702,467 members (74,079 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 417.2K 35.6K 144
A simple description and sample of creating a global low level keyboard hook in C#
key preview
key preview
key preview
key preview.exe
key preview.pdb
key preview.vshost.exe
key preview.suo
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)) {

		#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();
			// 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.KeyPreview = true;
			this.Name = "Form1";
			this.Text = "Form1";
			this.Load += new System.EventHandler(this.Form1_Load);



		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.


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


About the Author

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

You may also be interested in...

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