Questions tagged [mouse-hook]

Changing, listening or reacting to events related to specific mouse events.

A mouse hook is a feature that allows to replace or extend the standard behavior for specific mouse events in a systematic way.

The hook may work at a low level, by replacing some system routines at operating system level or at driver level. It is different from a simple event listener, in that the hooks behavior is not specific for a software feature, but is general to the whole application or event to the whole system.

Related tags

  • Use tag for hooking other event drivers than those of the mouse.
  • Use age for hooking mouse keys and keyboard keys
  • Use tag for .Net mouse key hooking

See also

92 questions
1
vote
2 answers

WinApi: Can the message loop be interrupted by an Async Procedure Call?

The following code register a low level mouse hook to monitor mouse events globally. It's the simplest working example I can get. Compiled with VC++ 2010: cl test.cpp /link /entry:mainCRTStartup /subsystem:windows #include HWND label1…
GetFree
  • 40,278
  • 18
  • 77
  • 104
1
vote
1 answer

Repeat message in Mouse Proc C++ Win32

I have a procedure that when a user press Ctrl button and right click it will show a message box to screen. But it has a loop, I only press Ctrl button and right click once time but it shows a sequence of message box. How to fix…
Hieu Dinh
  • 692
  • 5
  • 18
1
vote
1 answer

Running a C++ Event Loop WITHOUT using QT

I have been trying to develop a background Windows application in c++ to capture system wide keystrokes and mouse clicks (no I'm not writing a keystroke logger, just keystroke rates!). For this I have figured out that I need to use Windows Hooks and…
Tommy
  • 176
  • 1
  • 2
  • 17
1
vote
3 answers

MouseHook, MouseDown and MouseClick split

I have a little problem. I tried to look at google, but it gave me nothing much. I made a little program that uses global hooks and get mouse coordinates on click. The problem is when I made a second method with MouseDown and when I just click a…
Macas
  • 560
  • 3
  • 22
1
vote
0 answers

Invalid hook handle error is occurred after UnhookWindowsHookEx() is called

I am developing a window application c# .net. That application is used to connect other machine(window machine) with remote desktop connection and monitor the what user did on that remote machine. To monitor the user actions, I installed the custom…
1
vote
1 answer

Best way to suspend low level hook (winapi)

I would like to know what's the best way, in term of efficiency (cpu/memory usage), to temporarily suspend/bypass a low level mouse/keyboard hook. The current solution I found is to set a global var, "doHook" in the exemple, test it in the hook proc…
jj.jpnt
  • 199
  • 1
  • 12
1
vote
0 answers

This code has a function call with no parameters - working in C# but NOT VB.NET

I'm trying to use this code, which is in C#, in VB.NET. The code's purpose is to read the mouse coordinates and output them when you click the mouse button, using a Console application. Yes, I realise this is a stupid use of a Console application,…
Lou
  • 2,200
  • 2
  • 33
  • 66
1
vote
2 answers

MouseProc hook and WM_LBUTTONDBLCLK

I have a hook setup for getting mouse events in a plugin I develop. I need to get the WM_LBUTTONDBLCLK, and I expect the message flow to be: WM_LBUTTONDOWN, WM_LBUTTONUP, WM_LBUTTONDBLCLK If I call the next hook when dealing with the first…
macfarley5
  • 13
  • 2
  • 4
1
vote
3 answers

WM_MOUSEWHEEL only works in one direction on Windows 7 / 64bits

I made this code for 3D Effect in a Game, this code help change Possition and Zoom In + Out the screen! But if I run it on win 7 64 bits, when scroll the mouse wheel, both forward and backward, it Zoom In only but it works correctly when run on…
1
vote
1 answer

Can I suppress selected input before the application's main loop?

As part of my Visual Studio utilities add-in SamTools, I have a mouse input routine that catches Ctrl+MouseWheel and sends a pageup/pagedown command to the active text window. Visual Studio 2010 added a new "feature" that uses that gesture for zoom…
Sam Harwell
  • 97,721
  • 20
  • 209
  • 280
0
votes
0 answers

VBA Access MouseHook Wrapper

So, my main goal is to be able to move / resize the main access window along with a popup form, that is, when the main form is moved/resized, i want the main window to follow. So, with the help of some online code and chatgpt i've narrowed it down…
0
votes
0 answers

How to resolve the interference of the python tkinter application by global mouse events

I used the tkinter module of python and wrote a GUI program containing the Menu control. But at runtime, I found that when I clicked the menu, it displayed, but disappeared at once, unless I kept holding down the left-button. btw, the response…
Brant
  • 1
  • 1
0
votes
1 answer

Low Level Mouse Hook: Dealing with applications which prevent capturing

I noticed that my mousehook code fails to work when interacting with EA's Origin store. Basically when clicking inside of the window, it does not call the callback I registered with windows (using the SetWindowsHookEx function). I tried with Steam…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
0
votes
1 answer

Python Global Capturing and Disposing Mouse Click Event

I want to create a tool, which allows me to send keys to active window using my mouse. Let's say I want to send the key "A" when I click the left mouse button. But I also want to suppress / dispose that particular click event. So the target app will…
podcast
  • 131
  • 7
0
votes
0 answers

Failed to intercept WM_LBUTTONUP message with WH_GETMESSAGE or WH_MOUSE_LL

In development of GUI automation service, our team faces with the problem that we can not handle WM_LBUTTONUP message correct. The goal is to intercept WM_LBUTTONUP, disable active window, do our job and show MessageBox with YES and NO buttons: If…
user17939629