如何在创建的应用程序外获取对象名称? [英] How to get object names outside created application?

查看:44
本文介绍了如何在创建的应用程序外获取对象名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个应用程序,虽然它的运行和最小化将能够记录另一个程序活动(例如Word或PowerPoint)。获取对象名称(例如 - 单击文件或查看按钮)就足够了,但是可以在创建的应用程序之外获取此类信息吗?



是吗可以用C#做​​什么?

到目前为止,我只设法在创建的应用程序之外获取鼠标坐标(并在需要时禁用鼠标按钮)并记录有关它的信息,但我没有找到关于如何获取的信息来自另一个运行程序的最少的东西。



编辑:

我真的遇到了解释的问题)好吧,按对象名称我的意思是秒事情:例如,我单击按钮在Microsoft Word中查看或粘贴或插入或页面布局或B-Bold。我需要在文本文件中写下这个名字:查看,粘贴,插入,页面布局,粗体。这对我来说已经足够了,我不需要更多。



PS对我的英语很抱歉。

解决方案

< blockquote>一般情况下,您无法访问任何应用程序的外部进程,而这些进程并非专门为某些协作而设计。目前尚不清楚对象名称是什么意思,但是没有名为name的公共对象属性。请注意,有问题的应用程序不是.NET程序集,您至少可以在其中发现所有成员的类型,名称,成员和名称。即使您拥有此信息,也无法帮助您记录其活动(某些特定的活动除外)。您还应该了解进程是完全隔离的,并在不同的地址空间中执行。不同进程中的相同数值地址值实际上引用了内存中的不同对象。



-SA


查看关于此帖子在StackOverflow上的答案 [ ^ ]我不确定你会得到你所需要的,但它应该是一个很好的起点。


I am trying to create an application which, while its run and is minimized will be able log another program activities (for example Word or PowerPoint). Get the object name (for example - File or View button click) will be enough, but is it possible to get this kind of information outside created application?

Is it possible to do with C#?
So far I only managed to get mouse coordinates outside created application (and disable mouse buttons if I need to)and also log informatioon about it, but I didn;t found a thing about how to get at least something from another runned program.

Edit:
Well i really got a problem with explanation) Well, by object name I mean second thing: For example, I clicked button View in Microsoft Word or Paste or Insert or Page Layout or B-Bold. I need to write in text file this "names": "View", "Paste", "Insert", "Page Layout", "Bold". This is enough for me, I don't need more.

P.S Sorry about my english.

解决方案

In general case, you cannot access anything is an external process of an application which is not specifically designed for some collaboration. It is not clear what you mean by "object name", but there is no such thing as the common object property called "name". Note that the applications in question are not .NET assemblies where you could at least discover types, their names, members and names of all members. Even if you have this information, it does not help you to log its activities (except some specific ones). You should also understand that processes are thoroughly isolated and are executed in different address spaces. The same numeric address values in different processes actually reference different objects in memory.

—SA


Have a look at the answer to this post on StackOverflow[^] I'm not sure you'll get exactly what you need but it should be a good starting point.


这篇关于如何在创建的应用程序外获取对象名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆