Can a C# client record all keyboard and mouse events using hooks and collect information on the clicked GUI element?
Which libary would you use?
Is Spy++ an option or would one need a C++ DLL for that?
Can a C# client record all keyboard and mouse events using hooks and collect information on the clicked GUI element?
Which libary would you use?
Is Spy++ an option or would one need a C++ DLL for that?
Yes you can. See here and here. It's called event hooking.
You don't need any special library. Also, Spy++ is a standalone app that does this. Are you looking to write something like it with .NET?
It's better to do it in c++, you should register your hook, then you can create a bridge, but in C# may be Code project article is usefull.
Check out Deskperience and their Screen Scraper Studio product. Offers you a trial with the SDK.
Im trying to emulate their functionality at the moment, but finding it hard to do as Im a one man show...
UISpy.exe is a tool using .net Automation Framework and will allow you to experiment with what you can automate in C#.
Along with lower level keyboard and mouse hooks as described by Paul Sasik in this question, you can translate the screen location into a .net automation object and gain additional info about what is being clicked or typed at.