Consultor Eletrônico



Kbase P109787: How to get the handle of a parent window procedure from a child window or dialog
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/11/2005
Status: Unverified

GOAL:

How to get the handle of a parent window procedure from a child window or dialog

GOAL:

How to run a procedure in a parent window from its child.

FIX:

Use the parent Windows INSTANTIATING-PROCEDURE attribute.

For example if you wanted to run a procedure in a parent window from a child dialog or window the fallowing code in a suitable trigger would do this:

DEFINE VARIABLE h_widget AS HANDLE NO-UNDO.


h_widget = CURRENT-WINDOW.
REPEAT:
/* to get handle of parent window test for the parent window title */
MESSAGE
"PARENT " h_parent SKIP
"WIDGET TITLE " h_widget:TITLE SKIP
"WIDGET " h_widget SKIP
"INSTANTIATING-PROCEDURE : " h_widget:INSTANTIATING-PROCEDURE.

IF h_widget:TITLE = "PARENT" OR NOT VALID-HANDLE(h_widget) THEN LEAVE.
h_widget = h_widget:NEXT-SIBLING.
END.

RUN proc IN h_widget:INSTANTIATING-PROCEDURE.