Macro-recorder source

Hi all,

I need tot program something like the microsoft macrorecorder. It's for
observing users while performing some tasks with windows. So, I would
really like to record their movements and actions etc.

Has anybody got sources for this, or ideas perhaps?

Greeting,