Resolved How to find a .NET Form

Hy everybody,

I have a very simple program, that works since years and lists all Progress-Windows:

DEFINE VARIABLE phand AS HANDLE.
phand = SESSION:FIRST-CHILD.
DO WHILE VALID-HANDLE(phand):
IF phand:TYPE = "WINDOW" THEN MESSAGE phand:TITLE VIEW-AS ALERT-BOX.
phand = phand:NEXT-SIBLING.
END.


But now I have also ABL-windows, which are embedded in .NET Forms, and these are not shown.

Could anybody please tell me how to solve this problem ?

TIA, Wolf
 
Do you want the information for the embedded windows or for the .NET forms?

If for the ABL windows then usually these have been run persistently so one idea is to walk the widget tree for persistent procedures and obtain information from the procedure handle.

If though it is the .NET form title then maybe something along these lines:

Code:
DEFINE VARIABLE oForm AS Progress.Windows.Form NO-UNDO.
DEFINE VARIABLE oObject AS Progress.Lang.Object NO-UNDO.
DEFINE VARIABLE vName AS CHARACTER NO-UNDO.

ASSIGN oObject = SESSION:FIRST-OBJECT.
DO WHILE oObject <> ?:
   IF oObject:GetClass():TypeName = vName THEN DO:
      oForm = CAST(oObject, vName).
      MESSAGE oForm:Text VIEW-AS ALERT-BOX.
   END.
   oObject = oObject:NEXT-SIBLING.
END.
 
I want the information for the embedded windows.

And your idea of traversing the persistent procedures and inspecting their CURRENT-WINDOW instead of using SESSION:FIRST-CHILD is a nice one, I tried it and it works perfect !

Thanks
 
Back
Top