473,805 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hooking the keyboard

Please,

is there a way i can hook the keyboard? I would like to hook everykey.
CTRL+ALT+DEL, CTRL+ESC, and all others. The user just press some keys, and
none control keys, not only at my app but all windows.
A friend told me that there's a non-documented API that let me do this, but
he didn't remember the name.

Danke.

Fabiano
Nov 16 '05 #1
2 1500
The API is documented, look at SetWindowsHookE x and
UnhookWindowsHo okEx in the Win32 API.

--
Scott
http://www.OdeToCode.com

On Fri, 27 Aug 2004 16:12:25 -0300, "Fabiano" <a@a.com.br> wrote:
Please,

is there a way i can hook the keyboard? I would like to hook everykey.
CTRL+ALT+DEL , CTRL+ESC, and all others. The user just press some keys, and
none control keys, not only at my app but all windows.
A friend told me that there's a non-documented API that let me do this, but
he didn't remember the name.

Danke.

Fabiano


Nov 16 '05 #2
On Fri, 27 Aug 2004 16:12:25 -0300, "Fabiano" <a@a.com.br> wrote:
Please,

is there a way i can hook the keyboard? I would like to hook everykey.
CTRL+ALT+DEL , CTRL+ESC, and all others. The user just press some keys, and
none control keys, not only at my app but all windows.
A friend told me that there's a non-documented API that let me do this, but
he didn't remember the name.

Danke.

Fabiano


I'm working on hooks too. You can take a look at CodeProject. There
are a couple of articles that may help you.
http://codeproject.com/csharp/globalhook.asp
http://www.codeproject.com/csharp/GlobalSystemHook.asp

Hope this helps.
Nov 16 '05 #3

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

Similar topics

0
1595
by: Tony Pirkle | last post by:
In a former query: Modeless Form Ignores Keystrokes ONLY when called from VB.Net, I explain that I have a VB6 form that's not getting it's keystrokes. The events are firing, but the controls aren't responding to them. Is there a way to capture these keyboard events on the .Net side and resend the keys to VB6 (SendKeys comes to mind)? Please respond if you have an idea. Thanks!
1
5371
by: Matthew Kelly | last post by:
I have pulled together a VB.net project that hooks the keyboard (Ref. Paul Kimmel's hooking program) and allow the user to send "mouse right clicks" via the SendInpuut function (mouse emulation works fine). I am also trying to make this project capable of "Rearrange the keyboard" (example type "e" and "K" is sent to the application) by using SendInput function and I am not able to get it to work. I am finding the use of SendInput...
1
3715
by: Greg Merideth | last post by:
Is there a way via c# to hook a system tray application into the windows keyboard que globally so that when the application is running and you press, say, control-alt-shift-f11 the system tray app could respond to that keypress (much in the way my pgp app encrypts on ctrl-alt-e) even though its minimized and your in a different app? I've got an app thats a system tray and while its easy to access the data I'm just trying to add an extra...
3
4491
by: Rick Strahl [MVP] | last post by:
I'm working on an app that's using the WebBrowser control. I got the control working fine, hooking to the document object. But I've run into a major issue with hooking the Document events. Whenever I hook any of the HTMLDocumnetEvent2_Event events like this: HTMLDocumentEvents2_Event DocEvents = this.Browser.Document as HTMLDocumentEvents2_Event ; DocEvents.oncontextmenu += new...
0
323
by: William Hughes | last post by:
Hi, After doing a bit of googling, it seems everyone refers to the article "Managing Low-Level Keyboard Hooks in VB .NET" Written by Paul Kimmel - http://www.developer.com/net/net/article.php/11087_2193301_1/ When I implement this in a VB.NET Windows Forms application in Visual Studio 2002, everything works fine - I can hook the keyboard, trap keys, etc. When I take the same module and place it in my VB.NET Windows Forms
0
1187
by: Hema | last post by:
Hi all, I have developed a BHO that installs low level keybaord hooks and CBT hooks globally whenever IE is opened.The keys that are pressed when IE is active are to be captured.I am trying to check whether the IE is active first, If it is i set a boolean flag.In the key hook proc ,if the flag is set, the keys are sent for further processing.The keyboard hooks is working fine(when checked separately), but the CBT hooks is not working...
8
1975
by: pigeonrandle | last post by:
Hi, Has anyone had any experience with hooking messages in other application windows (like SPY++). I want to listen for WM_MOVE messages, but can only seem to find examples of Keyboard and Mouse hooks. Please (and thankyou), James Randle.
1
3743
by: zanthor | last post by:
Ok... so call me crazy, but I have an idea and I'm looking for where to start... I want to write an application that catches keystrokes and then either redirects them to the in focus window or another window based on some simple rules... in some cases the keystrokes would need to be sent out to multiple windows. I've done part of this in the past using a C++ application to hook the Win32 keyboard API and dispose of unwanted keystrokes...
1
2010
by: adam2009 | last post by:
Hey all, I try to find some code that will log to some txt file all the keystrokes in a smartphone. I have read many blogs about it, but I'm still confused. There are two blogs that i tried to understand 1.http://mikeunderhill.blogspot.com/2005/09/overriding-forms-wndproc-in-net-cf-20.html 2. http://blog.opennetcf.com/ayakhnin/CategoryView,category,Compact%20Framework.aspx
0
9716
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10361
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10103
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9179
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.