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

Capturing Windows Keys and Mouse Movements

P: n/a
Hi all,

Does anyone know how to capture the Windows Keys (I know
that they are out of the ascii key range) and how to
capture and record Mouse movements?

Thanks,

/Jonny
Nov 15 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Jonny,

If you need to do this for the entire system, then you need to set up
hooks into the system. In order to do this, you will have to call the
SetWindowsHookEx API function through the P/Invoke layer. However, if you
need to do it just for your application, then I recommend implementing the
IMessageFilter interface, and passing an instance to the static
AddMessageFilter method on the Application class. This will allow you to
process all the windows messages that go to your app before your app handles
them. You can then filter out the keyboard and mouse messages that you want
to handle.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jonny" <jo*****************@hotmail.com> wrote in message
news:07****************************@phx.gbl...
Hi all,

Does anyone know how to capture the Windows Keys (I know
that they are out of the ascii key range) and how to
capture and record Mouse movements?

Thanks,

/Jonny

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.