I would like to do something like this:
def var hObj as handle no-undo.
def var hChild as handle no-undo.
hObj = session:first-procedure.
do while valid-handle(hObj):
hChild = hObj:first-child.
do while valid-handle(hChild):
/************** trying to find Windows **********/
hChild = hChild:next-sibling.
hObj = hObj:next-sibling.
Since I can't find any window, I am doing something wrong :-) I would like to i.e. Count all Windows or manipulate an attribute within the Window-handle.
Anyone done this?
The chain of windows starts at SESSION:FIRST-CHILD. You can find all of the windows by traversing this chain.
Probably something like this (disclaimer: I've not tested this).
Perhaps you'll need to modify it to run recursively if you want to get every window.
define variable hWindow as handle NO-UNDO.
assign hWindow = Session:handle:first-child.
do while hWindow <> ?:
if lookup(hWindow:type, "WINDOW,DIALOG-BOX") <> 0 then
/* do whatever you need to do */
assign hWindow = hWindow:next-sibling.
aaah, thanks :-)