A crude example showing one simple way to save and restore a WIL Dialog's size and location.
;; Ini file with dialog position info.
strLocIni = DirScript():"LocateMe.ini"
;;; Save current dialog location to ini file.
#DefineFunction PlacementSave(strCaption, strLocIni)
strRect = WinPlaceGet(@Normal, strCaption)
IniWritePvt("Position", "rect", strRect, strLocIni)
return 1
#EndFunction
;;; Position dialog based on saved position in ini file.
#DefineFunction PlacementRestore(strCaption, strLocIni)
strRect = IniREadPvt("Position", "rect", "-1", strLocIni)
if strRect != "-1" then WinPlaceSet(@Normal, strCaption, strRect)
then return 1
else return 0
#EndFunction
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Rough example of UDF that can both save
;; and restore a dialogs location .
#DefineSubroutine LocateCallback(LocateMe_Handle,LocateMe_Message,LocateMe_Name,LocateMe_EventInfo,LocateMe_ChangeInfo)
switch LocateMe_Message
case 0 ;; Initialize.
PlacementRestore(LocateMeCaption, strLocIni)
DialogProcOptions(LocateMe_Handle,2,@TRUE) ; Button clicks.
;;DialogProcOptions(LocateMe_Handle,11,@TRUE) ; System menu Close.
break
case 2 ;; Button pressed
;;case 11 ;; System menu close. (Uncomment for close system menu.)
PlacementSave(LocateMeCaption, strLocIni)
break
endswitch
return(-1)
#EndSubroutine
LocateMeFormat=`WWWDLGED,6.2`
LocateMeCaption=`Locate Me`
LocateMeX=-1
LocateMeY=-1
LocateMeWidth=326
LocateMeHeight=245
LocateMeNumControls=002
LocateMeProcedure=`LocateCallback`
LocateMeFont=`DEFAULT`
LocateMeTextColor=`DEFAULT`
LocateMeBackground=`DEFAULT,DEFAULT`
LocateMeConfig=0
LocateMe001=`079,230,033,010,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,10,32,DEFAULT,DEFAULT,DEFAULT`
LocateMe002=`201,230,033,010,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,20,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("LocateMe")