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
0
votes
2 answers

How to detect a mouseclick event while MouseHook is set?

I am creating a tool that grabs the color of anything on the screen, whether it be inside the form or even outside the form. The user will use their mouse cursor to grab any pixel on the screen by clicking on it. The problem is that depending on…
BuddyRoach
  • 162
  • 1
  • 19
0
votes
1 answer

How to Unhook two hook procedures simultaneously?

In my application I created two procedures namely callbackwnd procedure to handle focus events and mouse procedure to handle mouse click events.when I unhook the two procedure the application will flicker little bit.how to overcome this? I also…
karthik
  • 17,453
  • 70
  • 78
  • 122
0
votes
1 answer

Problems with creating a mouse hook using the Windows API

I am trying to create a mouse hook using the Windows API. Currently, I have the following code, but I am struggling to make it work. Perhaps some sample code would help me to understand the concepts better. LRESULT CALLBACK MouseProc(int nCode,…
karthik
  • 17,453
  • 70
  • 78
  • 122
0
votes
1 answer

c++: window re-position with global mouse hook

I'm trying to develop the app like desktop divider. I used global mouse hook (low level mouse hook) because when left button up after dragging window into specific position, the window located into specific position and resized. First, I've tried to…
Cris Austin
  • 23
  • 1
  • 6
0
votes
0 answers

C programming Mouse Hook Proc

I want the messagebox to appear whenever I click my mouse, how do I achieve it? do mouse clicks have virtual key code like keyboard presses do? Do I also need to use lparam with MouseHookStruct, please help me with the Callback Function. Nothing…
user7813357
0
votes
1 answer

How to send notification with mouse/key hook data from C# dll to wpf exe

I am creating a C# WPF exe and a C# DLL. There is a function called StartRecording in DLL. The exe calls this function. The function installs Low-level mouse and keyboard hooks on a third party application (e.g. MS Word). Inside the hook procedures,…
Avinash
  • 385
  • 3
  • 11
  • 26
0
votes
1 answer

Picking up pascal mouse movements in java

I have a macro tool that runs using pascal. I need to track the movements of the mouse while the program is running over very long periods of time. I wrote a basic mouse recorder in java that draws the movements and clicks in slow motion so they are…
Colby
  • 452
  • 4
  • 19
0
votes
1 answer

VB6 mouse hook to capture a control a user clicks

I have a keyboard hook that listens for [shift] + [F12] key button press to activate an edit mode in my program. By edit mode, I mean that any form that is inactive in the program window is disabled and focus is set to the active window.…
AgotSdev
  • 31
  • 6
0
votes
3 answers

PInvokeStackImbalance - invoking unmanaged code from HookCallback

my goal i want to translate a left click to a right click my approach i register a low-level hook via SetWindowsHookEx (user32.dll) filter left-mouse-clicks check if i want to translate THAT specific click in case that i really want to do not…
santa
  • 983
  • 9
  • 30
0
votes
1 answer

Interrupt Mousehook, dispose and create new Mousehook?

I am using a Mousehook ( I tried 2 different hooks) but it crashes. I think the reason for that is doing mouseclick during unfinished calculations. I don't know the exact reason but after a while it stops working. So I tried another thing, everytime…
0
votes
1 answer

Calling method inside of mouse hook code causes access violation

I have a low level mouse hook which I am attempting to use to handle global left click events. I have defined the hook in a base main form class like so: class TMainForm : public TForm { private: HHOOK hMouseHook; static LRESULT CALLBACK…
James Hogle
  • 3,010
  • 3
  • 22
  • 46
0
votes
1 answer

Mouse hook, respond only when clicked on Button

I developed C# application which responds to low level mouse clicks. I used mouse hook to do this. The application is working fine, whenever i click any window it responds and perform some task. But i want to do a modification here. I wanted to…
Vignesh
  • 78
  • 2
  • 6
  • 14
0
votes
1 answer

Low level mouse hook getting cursor position and hwnd

I have a quick question. I created a standard window with the window api from the MSDN creating a window site. What I want the program to do is change the title of the window the mouse cursor is at when i press a key on the keyboard. To do so i've…
Omar Martinez
  • 37
  • 1
  • 6
0
votes
1 answer

how to Install global mouse Hook for certain UI like "desktop"

the code so far installs a hook to detect the mouse activity but what i want is either to filter the activity for certain UI or to detect where the clicks has occurred (on which hwnd ) exactly 'Desktop' is there a way ? this is the code i've used…
0
votes
1 answer

VC++ : How to get Window Handle of the firefox browser using Mouse Hook?

CODE IN DLL : extern "C" __declspec(dllexport) bool install() { hHookcbt = SetWindowsHookEx(WH_CBT, (HOOKPROC)CBTProc, hinst, 0); hook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC)MouseProc, hinst, 0); khook =…