tags:

views:

42

answers:

1

Hi,

How can I record click strokes and then put them into an array? Also does the window always need to be in focus for it to work? How can I avoid this.

+1  A: 

The requirement that this works without having a focused window is the more difficult one. You need to use a low-level mouse hook with the SetWindowsHookEx() API function. This requires P/Invoke, a good example is available in this blog post.

Hans Passant