By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,695 Members | 1,473 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,695 IT Pros & Developers. It's quick & easy.

How to use Keyboard hooks in C# ?

P: n/a
(Type your message here)

--------------------------------
From: Salim Ansari
Can anybody please give me sample code in C# to use keyboard hooks in C#?
THat would be a great help.
Thanks in advance
Salim

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>mroDNcUncEqajW2V78NbDw==</Id>
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Here is an example to capture the enter key.

protected override bool ProcessCmdKey( ref Message msg, Keys keyData )
{
if( keyData == Keys.Enter )
{
MessageBox.Show( "Enter pressed!" );
return true;
}
return base.ProcessCmdKey( ref msg, keyData );
}
Hope this helps

Publicjoe
C# Tutorial at http://www.publicjoe.f9.co.uk/csharp/tut.html
C# Snippets at http://www.publicjoe.f9.co.uk/csharp/snip/snippets.html
"Salim Ansari via .NET 247" <an*******@dotnet247.com> wrote in message
news:#g**************@TK2MSFTNGP11.phx.gbl...
(Type your message here)

--------------------------------
From: Salim Ansari
Can anybody please give me sample code in C# to use keyboard hooks in C#?
THat would be a great help.
Thanks in advance
Salim

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>mroDNcUncEqajW2V78NbDw==</Id>

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.