473,768 Members | 7,620 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capturing Global Mouse and Keyboard Events

Hi,

I would like to enable my VC++ application to capture general mouse
and keyboard events (click, double-click, key press) that occur
outside of my application's frame (eg. clicking inside the frame of
another application). I'm quite sure this is possible, but I don't
know how to do it. Anyone have experience with this?

Thanks in advance for your help.

Aug 13 '07 #1
3 4574
Hi,

Set hooks using SetWindowsHookE x().

Hope this helps.

Dinesh Venugopalan
"wbyeats" <va**********@g mail.comwrote in message
news:11******** *************@l 22g2000prc.goog legroups.com...
Hi,

I would like to enable my VC++ application to capture general mouse
and keyboard events (click, double-click, key press) that occur
outside of my application's frame (eg. clicking inside the frame of
another application). I'm quite sure this is possible, but I don't
know how to do it. Anyone have experience with this?

Thanks in advance for your help.

Aug 13 '07 #2
Thanks, Dinesh.

That put me on the right track. Now I'm just trying to figure out
DLLs.
Aug 15 '07 #3
wbyeats wrote:
Thanks, Dinesh.

That put me on the right track. Now I'm just trying to figure out
DLLs.
wbyeats:

You might find this article useful.

<http://www.codeproject .com/dll/hooks.asp>

There are some other hook articles on Codeproject also.

--
David Wilkinson
Visual C++ MVP
Aug 16 '07 #4

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

Similar topics

8
3422
by: Nolan Martin | last post by:
Is it just me or are there no good librarys out there to access the keyboard or mouse? I have been looking around for a while now and can only find ones that are bundled with a bunch of other stuff that I dont need (SDL, GLUT). I just need a simple platform independant way to access the keyboard and mouse. Anyone know of any good ones?
13
1725
by: lost hope | last post by:
hi, i have a very simple html page with a global variable, a function to increment its value, and a form that calls the function. however, what happens is that every time i click the image, the page is reloaded, and the value is reset to 1. is this what i should be expecting? are global variables not persistent across reloads? if this is the case, how can i set it up so that clicking the button doesn't reload the page automatically,...
9
5727
by: Will Pittenger | last post by:
If I were writing a C++ program, I would write a mouse hook. Does C# and ..NET 1.1 have anything equivalent. If not, I suppose I will need to use the Win32 API. ---------- Will Pittenger E-Mail: mailto:will.pittenger@verizon.net All mail filtered by Qurb (www.qurb.com)
5
4746
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event gets triggered and the double click is not identified at all. Is there any way I can invoke the double click when the mouse move also exists?
0
2778
by: learner404 | last post by:
Hello, I have a Windows Pyhon-Tk app which need to capture mouse end keyboard events even when the app is not in focus. On Windows so far I've used the excellent PyHook which does the job perfectly: " The pyHook library wraps the low-level mouse and keyboard hooks in the Windows Hooking API for use in Python applications."
16
10937
by: dfaber | last post by:
Hi all, I have been searching for a keyboard and mouse tracker on linux. I've read solutions (watch at sourceforge) which look at /proc/interrupts to check keyboard or mouse activity. I also read one post where "watch" seems to have difficulty tracking usb keyboards and mice. So, I'm out of ideas here. My goal are: 1. Check keyboard activity. I'm not interested in logging which keys are pressed or record them.
0
1614
by: Gamey | last post by:
I have an application that NEEDS (don't ask) to handle additional mouse and keyboard processing during DoDragDrop. Normally, DoDragDrop kindly squashes all keyboard and mouse events. Alternate, more specific events, are used in their stead such as DragEnter, DragLeave, DragHover, GiveFeedback, and QueryContinueDrag. None of these give me access to the general state of the keyboard or to mouse events ( in my case I really need the mouse...
1
4799
by: pavanjosh | last post by:
Hello All, I want to develop an application which is a banking application. I have already developed a application in .NET , C#. The major functionality of this application is automatic logging off from the application. In that regard, i am planning to write 2 threads. one thread to listen to system events and keep a counter and the other thread checks if in a particular time any events are there then it will not logg off, otherwise it...
3
1383
by: nomihn0 | last post by:
I'd like to accept mouse gestures and keyboard shortcuts as input to a program. The nature of this program requires that these commands be issued regardless of the currently active window. Here's the rub: I need a platform-independent solution. Java supports with its MouseInfo class, but I'd like a Python equivalent without turning to Jython. Is this possible? Thanks in advance.
0
9575
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
10171
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...
0
10015
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9842
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
6656
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5280
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
5425
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3931
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.