Forum Navigation
You need to log in to create posts and topics.

Re: Inactive window loc

Posted by: mel <mel@...>

>How do I get the location of an inactive window without activating it. It
>has something to do with GET WINDOW, right?
>Any help is appreciated.

Heres what I use to get the window position of my stuff when I close or quit :

DIM ListWindow;8
DIM LaunchWindow;8
DIM TimeWindow;8

END GLOBALS

LOCAL FN getWindowPos(whichWindow,wndRect&)
DIM rect;0,t,l,b,r:' default rect
to use
state=_False
LONG IF WINDOW(-whichWindow):' see if the window is built first (returns
true)
WINDOW whichWindow:' select this
window
WINDOW OUTPUT whichWindow:' then set it as output
window
wndPtr&=FN FRONTWINDOW:' get the window pointer that we
need
LONG IF wndPtr&:' make sure we got a pointer
to it
rect;8 = wndPtr& + _portRect:' copy the port rect over
for us
CALL LOCALTOGLOBAL(t):' convert these back to
sizes
CALL LOCALTOGLOBAL(b):' so we know where it is
globally
BLOCKMOVE @rect,wndRect&,8:' copy back to
prefs
state=_True:' and show that we can
close it
XELSE
SOUND "beepbeep"
END IF
END IF
END FN=state
'
LOCAL FN SaveListWndPos:' save the position of the window list
state=FN getWindowPos(_LISTWND,@ListWindow):' go get this window pos
IF state THEN WINDOW CLOSE _LISTWND
'
state=FN getWindowPos(_LAUNCHWND,@LaunchWindow):' go get this window pos
IF state THEN WINDOW CLOSE _LAUNCHWND
'
state=FN getWindowPos(_TIMERWND,@TimeWindow):' go get this window pos
IF state THEN WINDOW CLOSE _TIMERWND
'
END FN

Hope it helps...

Mel Patrick - theWabbitGuy - mel@intergate.bc.ca
http://www.intergate.bc.ca/business/mel