Reputation: 5959
I need help on how to implement support for recording user events in a .net application just like macro in office. SO if the user records his actions, all the things he performed will be re executed.
Some other apps like Notepadd++ has this feature too, i don't know if this is possible in .net
thanks
EDIT I saw this article in code project Writing a Macro Recorder/Player using Win32 Journal Hooks that does hooking to mouse and keybord, how does one do that in .net
Upvotes: 0
Views: 114
Reputation: 8785
I've implemented that in one of my applications.
I used a command pattern in my architecture. The record button in the application sets a RecordingFlag. While the RecordingFlag is true, store all the executed commands (read Command pattern first to understand this) until RecordingFlag is false (user push record button again).
Running the recorded macro is just iterate the stored commands and execute them in order.
Upvotes: 1