FB II Compiler

PG PRO

Debugging

Memory

System

Mathematics

Resources

Disk I/O

Windows

Controls

Menus

Mouse

Keyboard

Text

Fonts

Drawing

Sound

Clipboard

Printing

Communication

ASM

Made with FB

WINDOWS

Store window's position


Two ways:

1. Use PGpro.

2. Get the parameters of the window and save them in a preference file. When your program goes to re-open a window, have it look to the preference file and open the window at the last location and size.

tedd


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

Mel Patrick