473,395 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do I Capture a "key press"

Hi,

Could someone give me a pointer to do the following:

I would like to capture a keystroke from "anywhere" , i.e If the user is in
Word, Excel, Myother app, desktop etc... and they press CTRL+F12 I would
like to capture this, pass it to my app and process my sub/function
dependant on the keystroke.

Thanks for any pointers

Mike
Nov 20 '05 #1
4 5826
Hi Mike,

You need to install a system-wide keyboard hook. The following example
should help you...

http://www.developer.com/net/net/art...1087_2193301_3

HTH,
Gary

"Mike R" <Mi**@mikeread.freeserve.co.uk> wrote in message
news:c4*******************@news.demon.co.uk...
Hi,

Could someone give me a pointer to do the following:

I would like to capture a keystroke from "anywhere" , i.e If the user is in Word, Excel, Myother app, desktop etc... and they press CTRL+F12 I would
like to capture this, pass it to my app and process my sub/function
dependant on the keystroke.

Thanks for any pointers

Mike

Nov 20 '05 #2
Hi Mike,

You need to install a system-wide keyboard hook. The following example
should help you...

http://www.developer.com/net/net/art...1087_2193301_3

HTH,
Gary

"Mike R" <Mi**@mikeread.freeserve.co.uk> wrote in message
news:c4*******************@news.demon.co.uk...
Hi,

Could someone give me a pointer to do the following:

I would like to capture a keystroke from "anywhere" , i.e If the user is in Word, Excel, Myother app, desktop etc... and they press CTRL+F12 I would
like to capture this, pass it to my app and process my sub/function
dependant on the keystroke.

Thanks for any pointers

Mike

Nov 20 '05 #3
Thanks Gary
"Gary Milton" <an*******@discussions.microsoft.com> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
Hi Mike,

You need to install a system-wide keyboard hook. The following example
should help you...

http://www.developer.com/net/net/art...1087_2193301_3

HTH,
Gary

"Mike R" <Mi**@mikeread.freeserve.co.uk> wrote in message
news:c4*******************@news.demon.co.uk...
Hi,

Could someone give me a pointer to do the following:

I would like to capture a keystroke from "anywhere" , i.e If the user is

in
Word, Excel, Myother app, desktop etc... and they press CTRL+F12 I would
like to capture this, pass it to my app and process my sub/function
dependant on the keystroke.

Thanks for any pointers

Mike


Nov 20 '05 #4
Thanks Gary
"Gary Milton" <an*******@discussions.microsoft.com> wrote in message
news:Oi**************@TK2MSFTNGP10.phx.gbl...
Hi Mike,

You need to install a system-wide keyboard hook. The following example
should help you...

http://www.developer.com/net/net/art...1087_2193301_3

HTH,
Gary

"Mike R" <Mi**@mikeread.freeserve.co.uk> wrote in message
news:c4*******************@news.demon.co.uk...
Hi,

Could someone give me a pointer to do the following:

I would like to capture a keystroke from "anywhere" , i.e If the user is

in
Word, Excel, Myother app, desktop etc... and they press CTRL+F12 I would
like to capture this, pass it to my app and process my sub/function
dependant on the keystroke.

Thanks for any pointers

Mike


Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: microsoft | last post by:
When I create a instance of web services proxy in winform, I get the exception. Stack Trace: System.ArgumentException: Item has already been added. Key in dictionary:"winbootdir" Key being...
1
by: Andrea Williams | last post by:
I've created a simple search form and a submit button. On click of the button, I have code-behind that runs and fills a datagrid. However, it the person is focused on one of the other controls...
0
by: Mike R | last post by:
Hi, Could someone give me a pointer to do the following: I would like to capture a keystroke from "anywhere" , i.e If the user is in Word, Excel, Myother app, desktop etc... and they press...
0
by: Ralf Gedrat | last post by:
Hello! I have a Application, this throws after some time following exception: Item has already been added. Key in dictionary: "- 1" key being added: "- 1" I use Application.Run with...
0
by: roxanaislam | last post by:
Hi: I have a search form in my application which has 4 dropdown list controls, one text box, one "GO" button, one "reset" button. When the "GO" button is clicked the form gets submitted and the...
4
by: roxanaislam | last post by:
Submitting Form by pressing the "ENTER" key -------------------------------------------------------------------------------- Hi: I have a search form in my application which has 4 dropdown...
0
by: Ismail Fatih Yıldırım | last post by:
I modified the RSACSPSample from MSDN to try out a simple commutative encryption model using RSA encryption but when i run the progrem the first encryption command works but during the second...
0
by: huckfinn19 | last post by:
Hi all, I am using C# 2.0. Here is my problem. I have a modal form with an OK button. When the user, using tabs, activates the OK button and presses "Enter", in the Button event, I call: ...
7
by: raghunadhs | last post by:
with help of key press evnt i am able to find the KeyAscii values.. but i am unable to find the ascii values of "delete","home","pageUp", ...etc.. In my application there is a need to find...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.