如何获取给定 HWND 句柄的 PowerBuilder 图形对象?

发布于 2024-08-11 05:25:32 字数 320 浏览 1 评论 0原文

在我的 (PowerBuilder) 应用程序中,我希望能够确定与给定窗口句柄对应的 graphicobject 对象。

简单地迭代 Control[] 数组并比较每个子控件的 Handle() 函数返回的值是行不通的,因为并非我的对象中的所有对象都有效。应用程序是主窗口的子窗口(考虑登录对话框)。

任何 PowerScript 或 C/C++ 解决方案都是可以接受的。

是否有一些窗口消息我可以发送到窗口句柄,并且该消息只能由 PowerBuilder 窗口理解,它会用其内部对象名称等进行响应?

In my (PowerBuilder) application, I'd like to be able to determine the graphicobject object which corresponds to a given window handle.

Simply iterating over the Control[] array and comparing the value returned by the Handle() function for each of the child controls doesn't work, since not all objects in my application are children of the main window (consider of login dialogs).

Any PowerScript or C/C++ solution would be acceptable.

Is there maybe some window message I could send to window handles, and this message is only understood by PowerBuilder windows, which would the respond with their internal object name, or the like?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兔小萌 2024-08-18 05:25:32

是要求从句柄中确定对象,还是只是想识别一个对象,例如知道需要修改的代码在哪里?我制作了一个工具来执行后者,但它使用对象焦点,而不是窗口句柄。


(2010-06-21 添加)对于不是主窗口子窗口的窗口,您可以使用 isValid() 显式检查每个窗口类名称。然后,对于每个有效窗口,深入查找句柄。只要您一次只打开窗口类的一个实例,这一点就应该有效。如果您打开多个实例,我认为您需要向这些窗口的 open 添加注册机制,以便应用程序能够访问它们。

Is it a requirement to determine the object from the handle, or do you just want to identify an object, for example to know where the code you need to modify is? I made a tool that does the latter, but it uses object focus, rather than window handles.


(added 2010-06-21) For windows that aren't children of the main window you could explicitly check each of these window class names with isValid(). Then for each valid window, dig through looking for the handle. This should work as long as you only open one instance of the window class at a time. If you open multiple instances, I think you'll need to add a registration mechanism to the open of those windows so the application has a way to access them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文