473,405 Members | 2,287 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,405 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 5828
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.