I have an app that runs in the background (minimized/task tray). I need to be able to detect mouse activity (clicks, move) as well as keyboard activity.
What is the best way to do this given the constraint that my window is not "focused" ?
Take a look at this library http://globalmousekeyhook.codeplex.com/. It is 100% managed c# code to install global mouse and keyboard hooks. It wraps low level hooks into common windows forms keyboard and mouse events.