How to get a PowerBuilder graphic for a given HWND handle?

In my application (PowerBuilder), I would like to define a graphicobject that matches the given window handle.

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

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

Maybe some window message that I could send to window descriptors, and this message is understood only by PowerBuilder windows that respond to their internal object name or the like?

+4
source share
1 answer

Do you need to define an object from a descriptor or just want to identify an object, for example, to find out where you need to change the code? I created a tool that does the latter, but uses object focus, rather than window handles.


(added 2010-06-21) For windows that are not children of the main window, you can explicitly check each of these window class names with isValid() . Then, for each valid window, dig out a handle. This should work as long as you open only one instance of the window class at a time. If you open several instances, I think you need to add an open registration mechanism for these windows so that the application has access to them.

+1
source

All Articles