How do I get the PowerBuilder graphicobject for a given HWND handle?
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 开发者_如何学JAVAtheir internal object name, or the like?
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.
精彩评论