另外一个有关的Win32 VS UI自动化 [英] Another one about Win32 Vs UI Automation

查看:142
本文介绍了另外一个有关的Win32 VS UI自动化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个(网络/ WinForms应用程序我也不能决定),我有我不能以任何方式通过我的新的应用程序访问运行简单的WinForms应用程序,我只是想读一些价值观和也许编辑一些值(标签,按钮,一些琐碎的东西)。所以我用间谍++作为<一个建议href=\"http://stackoverflow.com/questions/7706511/how-to-get-a-value-of-a-radiobutton-from-a-winform-application-that-i-dont-have\">this问题。

所以,我能看到,我需要通过这个伟大的工具来阅读/编辑的值。和我能够编辑一些值(例如隐藏,取消选中,禁用等一些标签和按钮),他们反映在应用程序。

所以,我想移动到下一个步骤,我被告知,我有两个选择。无论是Win32的或UI自动化。我不知道他们俩的线索,所以一些指导将是巨大的。

我只是有3个关于这个问题的问题:


  1. 这将是更好地使用针对WinForms和为什么?


  2. 和是否有任何的两个选项可以通过web应用中使用或两个选项都需要在WinForms应用程序中实现?


  3. 是否任何这些选项在编辑值的限制吗?



解决方案

(如果你还在寻找..)

这取决于什么是铁道部熟悉。此外,一般来说,我认为,UI自动化是稍微容易些,因为对Wind32SDK你需要使用大量的PInvoke之类的东西的这可能不来容易纯.NET的人。

对于Win32, http://www.pinvoke.net/default.aspx/ 真的是开始,给你所有的签名和一些样本code一个最伟大的地方。

有关UI自动化,还有很多地方也开始有很多样品。其中之一是很多 http://blogs.msdn.com/b/winuiautomation/

另外请注意,它们不是在电源和可用性媲美。就像说,UI自动化更自然,Win32上可允许你访问你无法通过自动化实现多值。我觉得UI自动化主要是只读的。

这是有趣的启用/在外国申请禁用按钮。当发现自己的经常工作我想使用它的一些受到保护的商业产品(即只是有亲按钮已禁用)只是为了检查是否有到位的额外保护。:)含义,以及,如果你想能有这样的功能,在您的应用程序,知道用户总是可以使一个隐藏的元素可见或禁用一个启用。

I'm building a (Web/WinForms Application I didn't decide yet) and I have a running simple WinForms Application that I couldn't access through my new application by any means and I just want to read some values and maybe edit some values (Labels, Buttons, some trivial stuff). so I used Spy++ as advised in this question.

So, I was able to see the values that I need to read/edit through this great tool. and I was able to edit some values (Like hide, Uncheck, Disable, etc on some labels and buttons) and they reflected on the application.

So I want to move to the next step and I was advised that I have two options. Whether Win32 or UI Automation. I have no clue about both of them, so a little guidance would be great.

I just have 3 more questions regarding this problem:

  1. which would be better to use against WinForms and why?

  2. and does any of the two options can be used through a WebApplication or both options need to be implemented within a WinForms Application ?

  3. Does any of those options have a limitation in editing values ?

解决方案

(If you are still searching..)

It depends on what is mor familiar to you. Also, generally, I think, UI Automation is slightly easier, since for Wind32SDK you need to use a lot of pinvoke and stuff like that which probably does not come easy to pure .net people.

For Win32, http://www.pinvoke.net/default.aspx/ is really the one greatest place to start, giving you all the signatures and some sample code.

For UI Automation, there are a lot of places as well to start with lots of samples. One among many is http://blogs.msdn.com/b/winuiautomation/ .

Also note that they are not comparable in power and usability. Like said, UI Automation is more natural, Win32 also allows you to access many values you cannot reach through automation. I think UI Automation is mostly read-only.

It is fun to enable/disable a button in a foreign application. When finding out that it often works I thought to use it on some protected commercial product (that simply has the "pro" buttons disabled") just to check if there is an additional protection in place. :) Meaning as well that if you want to have such a feature in your app, know that a user can always make a hidden element visible or a disabled one enabled.

这篇关于另外一个有关的Win32 VS UI自动化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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