Here's a sample C# console application that will print the x and y coordinates of the mouse when a click event occurs:
main.cs1274 chars50 lines
This code uses P/Invoke to call the GetCursorPos
function in the Windows user32.dll
library. This function returns the current position of the mouse cursor, which is printed to the console when a click event is detected.
gistlibby LogSnag