适用于PowerBuilder应用程序的Spy ++ [英] Spy++ for PowerBuilder applications

查看:248
本文介绍了适用于PowerBuilder应用程序的Spy ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个工具,使我可以检查基于PowerBuilder的应用程序的状态。我在想的是类似Spy ++(或者甚至更好的 .Snoop,因为它存在于.NET应用程序中)之类的东西,它使我可以检查某些基于PowerBuilder的GUI的对象树(以及对象的属性)。

I'm trying to write a tool which lets me inspect the state of a PowerBuilder-based application. What I'm thinking of is something like Spy++ (or, even nicer, 'Snoop' as it exists for .NET applications) which lets me inspect the object tree (and properties of objects) of some PowerBuilder-based GUI.

我已经对普通的(基于MFC的)应用程序和.NET应用程序进行了相同的操作,但是不幸的是,我自己从未在PowerBuilder中开发过应用程序,因此我通常在考虑此时有两个问题:

I did the same for ordinary (MFC-based) applications as well as .NET applications already, but unfortunately I never developed an application in PowerBuilder myself, so I'm generally thinking about two problems at this point:


  1. 是否有一些API(最好是Java或C / C ++)可用,因此可以遍历
    PowerBuilder应用程序的可视对象树?我在PowerBuilder本机接口系统上阅读了一下,但这似乎是要用C / C ++编写PowerBuilder扩展,然后可以从PowerBuilder脚本语言调用它,对吧?

  1. Is there some API (preferably in Java or C/C++) available which lets one traverse the tree of visual objects of a PowerBuilder application? I read up a bit on the PowerBuilder Native Interface system, but it seems that this is meant to write PowerBuilder extensions in C/C++ which can then be called from the PowerBuilder script language, right?

如果有一些可用的API-也许PowerBuilder应用程序甚至公开了某种启用了IPC的API,这使我可以检查PowerBuilder对象层次结构的状态,而无需参与PowerBuilder应用程序的处理?也许有可用的自动化界面,或者基于COM的东西-也许还有其他东西?

If there is some API available - maybe PowerBuilder applications even expose some sort of IPC-enabled API which lets me inspect the state of a PowerBuilder object hierarchy without being within the process of the PowerBuilder application? Maybe there's an automation interface available, or something COM-based - or maybe something else?

现在,我的印象可能是需要将DLL注入PowerBuilder应用程序的进程中,然后获得对正在运行的PowerBuilder VM的访问权限,以便我可以向其查询对象树。然后,某种IPC机制将允许我将这些信息从PowerBuilder应用程序的过程中传输出去。

Right now, my impression is that probably need to inject a DLL into the process of the PowerBuilder application and then gain access to the running PowerBuilder VM so that I can query it for the object tree. Some sort of IPC mechanism will then let me transport this information out of the PowerBuilder application's process.

是否有人对此有所了解,或者可以阐明是否有人尝试过

Does anybody have some experience with this or can shed some light on whether anybody tried to do this already?

最诚挚的问候,


  • Frerich

推荐答案

首先,一个简单的答案:我认为您正在尝试做的事情已经完成, 。 启用启用Rex 确实可以满足您的要求,但是IIRC与开发人员交谈时,它依赖于应用程序中内置的代码挂钩。

First, the easy answer: I think what you're trying to do has been done, sort of. Rex from Enable does what I think you're after, but IIRC from talking with the developers, it depends on code hooks built into the application.

这会导致建议我认为您无法完全从应用程序外部进行操作。您可以使用WinAPI抓取窗口句柄,并以此做一些基本的事情,但是却不尽如人意。并获得有关带有WinAPI的DataWindows的信息?算了吧。

Which leads to the suggestion that I don't think you'll be able to do what I think you're trying to do completely externally from the application. You can grab window handles with WinAPIs and do some basic things with that, but not as much as you want. And getting information about DataWindows with WinAPIs? Forget it.

相信我听说过一种API,就像您要询问的那样,但我从未听说过其他任何一种自动化测试软件工具制造商开始使用它。如果这是正确的(并且此信息的质量沿在走廊中听到它的路线的线条),我怀疑释放此信息可能存在一些应用程序安全性问题。 (我知道您将永远不想感染我的应用程序,或者四处寻找我的秘密。咧嘴

I believe I've heard of an API like the one you're asking about, but I've never heard of anyone other that automated testing software tool manufacturers getting their hands on it. If this is true (and the quality of this information is along the lines of "heard it in the hallway"), I suspect there might be some application security issues in letting this get out. (I know you'd never want to infect my application, or poke around and find out my secrets. grin)

即使钩住了PowerBuilder VM的内存空间,我也不知道没有一些PowerScript框架钩子就无法获取内存中的对象列表(例如,在每个open和构造函数上填充一个带有对象句柄的列表)。有了窗口句柄后,就可以轻松地遍历其控件数组(及其子类控件数组)以获取窗口上的对象列表,但是诸如NVO实例变量的句柄之类的东西会出现问题。

Even with hooks into the PowerBuilder VM memory space, I'm not aware of being able to get a list of objects in memory without some PowerScript framework hooks (e.g. populating a list on every open and constructor with object handles). Once you've got a window handle, you can easily traverse its control arrays (and its subclasses control arrays) to get a list of objects on the window, but things like handles to NVO instance variables would be problematic.

我很欣赏这个主意。我希望我有更好的消息(除了Rex可能会解决您的问题而不必自己做的麻烦)。现在,我更加期待eran会发布什么! 咧嘴

I admire the idea. I wish I had better news (other than maybe Rex might solve your problem without the headaches of doing it yourself). Now I'm looking forward even more to what eran may release! grin

祝你好运,

Terry。

这篇关于适用于PowerBuilder应用程序的Spy ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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