473,396 Members | 2,002 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,396 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 5827
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...

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.