Search code examples
c#winformshookmouse-hook

C#: How do I get the coordinates of my mouse when left/right mouse button has been pressed?


How do I get the coordinates of my mouse when left/right mouse button has been pressed?

I am using a low level mouse hook and am able to get the current position of my cursor, but I would like to be able to retrieve the position when any mouse button has been pressed.

How can I do this?


Solution

  • http://www.codeproject.com/KB/system/globalsystemhook.aspx - this solved my problem. Used the DLL's from the demo project and managed to get the coordinates.