I want to build myself an application that will run in the background (system tray) and log the co-ordinates of my mouse whenever I click the left or right buttons. I found this code online to get the mouse co-ordinates through an event that triggers:
protected override void OnMouseMove(MouseEventArgs mouseEv)
{
txtMouseX.Text = mouseEv.X.ToString();
txtMouseY.Text = mouseEv.Y.ToString();
}
This points me in the right direction, I now know how I can get the X and Y co-ordinates of the mouse, but I don't know how to trigger a function or whatever on a mouse click if the application is running in the background. Also, it seems that this code only works in the form it is running in, not for the entire screen?
Any help is appreciated, cheers.