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

Detect Mouse Hook

I have an application that launches the Problem Steps Recorder utility that ships with Windows 7 and later that records all user mouse and keyboard interactions. It does so by creating a new Process instance and launching the PSR with a number of…
HotN
  • 4,216
  • 3
  • 40
  • 51
0
votes
0 answers

Low level mouse hook delta calculations erratic

I am using the example provided here: http://blogs.msdn.com/b/toub/archive/2006/05/03/589468.aspx Together with my own code to calculate mouse delta. Before anybody mentions it, I know there are ways in WPF and WF to directly access a mouse.delta…
Wobbles
  • 3,033
  • 1
  • 25
  • 51
0
votes
0 answers

Is it possible to check the current cursor is AFX_IDC_HSPLITBAR?

I am tried but no luck. Can anybody know, How to check the current cursor type is AFX_IDC_HSPLITBAR? My code. HCURSOR current_cursor1 = AfxGetApp () ->LoadCursor ( AFX_IDC_HSPLITBAR ) ; CURSORINFO current_cursor_info ; current_cursor_info.cbSize =…
bala
  • 275
  • 2
  • 3
  • 13
0
votes
1 answer

How to change the right with the left button?

I'm using the following winapi-code to change the right-button clicks with left-button clicks. LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam) { if (wParam == WM_RBUTTONDOWN) { return CallNextHookEx(NULL,…
cdonts
  • 9,304
  • 4
  • 46
  • 72
0
votes
0 answers

Log activity outside application

Maybe again incorrect question but: I am trying to create an application which will log each user mouse click while running in background. I managed to log each mouse click type (using Hook) but then i got a problem. I need not only to log each…
0
votes
1 answer

global mouse hook causes application crash (c++ / windows7)

I'm trying to write a dll to inject a global mouse hook in Windows 7. It basically works, but after some seconds (maybe 10 - 15) the whole application just freezes up and the mouse wont work outside Visual Studio (I can still stop the app via vs but…
wrongway
  • 1
  • 2
0
votes
1 answer

VB.NET - Making this application return two integers to set up mouse hook

I've managed to get this C# code (not my own!) working in VB.NET, to implement a mouse hook in a Console application. Here's the VB.NET code: Imports System.Runtime.InteropServices Imports System.Windows.Forms Module Module1 Class InterceptMouse …
Lou
  • 2,200
  • 2
  • 33
  • 66
0
votes
2 answers

Determine when a mouse hook has handled the last message

I have a form, that acts like a drop-down, that I display non-modal. I attach a mouse hook to the form to determine when the mouse is clicked out of it, so that I know to close it - by setting Visible = False. Because I want the HookProc to handle…
Jules
  • 4,319
  • 3
  • 44
  • 72
0
votes
1 answer

Strange behaviour with mouse hook in .NET and Windows Forms

I have a form that is displayed, not by ShowDialog, but by setting its visible property to true. This is so it behaves like a dropdown. The form installs a mouse hook, using SetWindowsHookEx(WH_MOUSE, ...). I detect if the mouse is clicked outside…
Jules
  • 4,319
  • 3
  • 44
  • 72
0
votes
2 answers

Confusion about mouse hooks in c++

I am trying to get global mouse position. I have a hook working that can get the mouse position, however it only has access to it inside the hook code. Trying to access the data inside main doesn't work. The best way to explain this is with…
motsu35
  • 21
  • 2
  • 5
0
votes
0 answers

Global Key/MouseHook with UI

I want to make a C# Application with a Keyboard and Mouse on screen. Every Key or Button that is clicked should be seen in this Application by for example coloring one of the keys ( i know how to do that ). This should also work if the Application…
Furious Gamer
  • 359
  • 1
  • 3
  • 16
0
votes
1 answer

Global Mouse Hook/Respond to Events in VB.Net 2012

Looking for source code example(s) of global mouse hooks compatible with VB.Net 2012. App requirement is basic: Intercept middle-click globally. Virtually every example I have found is out of date, buggy, or generates errors that make no sense and I…
RBLevin
  • 51
  • 6
0
votes
1 answer

Setting up mouse hook without removing currently running application?

I have a program that opens a GUI when run. I would then like to set up a mousehook using dllimports, but in order for it to work, I must call a new Application.Run() in this same class. Unfortunately though, this removes the original GUI. Is there…
Ari
  • 3,489
  • 5
  • 26
  • 47
-1
votes
1 answer

Erroneous Mouse Coordinates Returned from Low Level Mouse Hook C#

I'm building a WPF application with some hackery involved to embed Form elements on the same render layer. Essentially what I do is I render the form off-screen and have a mock-up of the form in a WPF image. I also have a low level mouse hook…
-2
votes
1 answer

Disable Right Button (global) in c# like AHK program

I know c# and i want create a fuction for deactive and active mouse left/right button only (in c# code) like a AHK program. Can you help me?
Greenjack
  • 13
  • 2