How to find left corner of window?

Posted by goo on 23-Feb-2017 07:51

We have an application that starts a .net Ribbon menue, and I am trying to find the upper left corner of the window. The reason for wanting that, is that we have a dynamic filter window that is postioned very wrong when using more than one screen. On my computer, I have three screens, so I would like to position the filter closer to the main window. 

I have tried walking both session:first-procedure and session:first-form, but I am not sure where to find the positon for the window.

What should I look for? How can I find the first window handle so that I can use the window object ?

Posted by Brian K. Maher on 23-Feb-2017 07:58

How about just using this...
 
THIS-OBJECT:Location:X and THIS-OBJECT:Location:Y
 
 

Posted by Peter Judge on 23-Feb-2017 10:20

Something like TYPE-OF(currentObejct, Progress.Windows.Form) should get you only the forms
 

Posted by Peter van Dam on 23-Feb-2017 10:16

Hi Geir,

I seem to have missed the introduction of FIRST-FORM and it seems handy. However, I see this note in the remarks:

"If you instantiate a Progress.Windows.IForm in a non-GUI ABL session, the object does not appear in the list of OpenEdge form objects, but only in the list of valid class-based objects."

I am not sure how to interpret this, but I would try using FIRST-OBJECT to find your ribbon form.

All Replies

Posted by Brian K. Maher on 23-Feb-2017 07:58

How about just using this...
 
THIS-OBJECT:Location:X and THIS-OBJECT:Location:Y
 
 

Posted by Peter van Dam on 23-Feb-2017 10:16

Hi Geir,

I seem to have missed the introduction of FIRST-FORM and it seems handy. However, I see this note in the remarks:

"If you instantiate a Progress.Windows.IForm in a non-GUI ABL session, the object does not appear in the list of OpenEdge form objects, but only in the list of valid class-based objects."

I am not sure how to interpret this, but I would try using FIRST-OBJECT to find your ribbon form.

Posted by Peter Judge on 23-Feb-2017 10:20

Something like TYPE-OF(currentObejct, Progress.Windows.Form) should get you only the forms

Posted by goo on 23-Feb-2017 13:50

Thanks :-) Brian, my problem was to find THIS-OBJECT, but Your was right, location:X and Location:Y gave me correct position :-)

Pete, thanks, I was looking for a way of finding the TYPE and suddenly you gave it to me.

Peter, thanks, that was why I never got any Luck With the FIRST-FORM... :-)

This gave me the correct result:

def var oObject as class Progress.Lang.Object no-undo.

oObject = session:first-object.

do while valid-object(oObject):

 if type-of(oObject,Progress.Windows.Form) then

 MESSAGE oObject:ToString()

 VIEW-AS ALERT-BOX.

 oObject = oObject:Next-Sibling.

end.

whitch was session:first-object.

This thread is closed