如何使用C#客户端获取另一个应用程序中单击的GUI元素的信息?
C# 客户端可以使用钩子记录所有键盘和鼠标事件并收集有关单击的 GUI 元素的信息吗?
您会使用哪个库?
Spy++ 是一种选择还是需要 C++ DLL?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
最好在 C++ 中完成,您应该注册您的钩子,然后您可以创建一个桥,但在 C# 中可能是 代码项目文章很有用。
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.
是的,你可以。 请参阅此处和此处。 这称为事件挂钩。
您不需要任何特殊的图书馆。此外,Spy++ 是一个独立的应用程序,可以执行此操作。您是否想用 .NET 编写类似的东西?
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?
查看 Deskperience 及其 Screen Scraper Studio 产品。为您提供 SDK 试用版。
我目前正在尝试模仿他们的功能,但发现很难做到,因为我是一个人展示...
链接到 Deskperience 网站
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...
Link to Deskperience Website
您拥有这个lib,它对于托管应用程序特别有用。但我不太确定它如何与非托管代码交互。
You have this lib, which is specially useful for managed apps. I'm not so sure how it interacts with non managed code though.
UISpy.exe 是一个使用 .net 自动化框架的工具,可让您尝试在 C# 中实现自动化的操作。
以及较低级别的键盘和鼠标挂钩,如 Paul Sasik 在这个问题中,您可以将屏幕位置转换为 .net 自动化对象,并获取有关单击或键入内容的其他信息。
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.