Byron,
#define ST_NORMAL 0
#define ST_ICONIZED 1
#define ST_ZOOMED 2
When close the ownd/dialog ->SetWinCoors()
Wnen activate the ownd/dialog call ::GetWinCoors to load position and move the oWnd/odlg in old position
sample :
WITH OBJECT oApp := TApplication():New()
:Activate()
END
METHOD New() CLASS tApplication
DEFINE WINDOW ::oWndMain
....
RETURN Self
METHOD Activate() class TApplication
::GetWinCoors()
::bResized := {|| ResizeWndMain() }
ACTIVATE WINDOW ::oWndMain ;
VALID ::ExitFromX()
::End()
::oFontMsgItem:End()
return NIL
/*_____________________________________________________________________________*/
/*_____________________________________________________________________________*/
/*___ OZScript ________________________________________________________________*/
METHOD GetWinCoors() CLASS TApplication
LOCAL oIni
LOCAL nRow, nCol, nWidth, nHeight, nState
nRow := VAL(GetPvProfString("Config", "nTop", "10", ::cIniFile))
nCol := VAL(GetPvProfString("Config", "nLeft", "10", ::cIniFile))
nWidth := VAL(GetPvProfString("Config", "nRight", "800", ::cIniFile))
nHeight := VAL(GetPvProfString("Config", "nBottom", "600", ::cIniFile))
nState := VAL(GetPvProfString("Config", "Mode", nState, ::cIniFile))
IF nRow == 0 .AND. nCol == 0
WndCenter(::oWndMain:hWnd)
ELSE
::oWndMain:Move(nRow, nCol, nWidth, nHeight)
ENDIF
IF nState == ST_ICONIZED
::oWndMain:Minimize()
ELSEIF nState == ST_ZOOMED
::oWndMain:Maximize()
ENDIF
UpdateWindow( ::oWndMain:hWnd )
::oWndMain:CoorsUpdate()
SysRefresh()
RETURN NIL
METHOD SetWinCoors() CLASS TApplication
LOCAL oIni
LOCAL nRow, nCol, nWidth, nHeight, nState
::oWndMain:CoorsUpdate()
nRow := ::oWndMain:nTop
nCol := ::oWndMain:nLeft
nWidth := ::oWndMain:nRight-::oWndMain:nLeft
nHeight := ::oWndMain:nBottom-::oWndMain:nTop
IF IsIconic( ::oWndMain:hWnd )
nState := ST_ICONIZED
ELSEIF IsZoomed(::oWndMain:hWnd)
nState := ST_ZOOMED
ELSE
nState := ST_NORMAL
ENDIF
WritePProString("Config","nTop",Ltrim(Str(nrow)),::cIniFile)
WritePProString("Config","nLeft",Ltrim(Str(ncol)),::cIniFile)
WritePProString("Config","nRight",Ltrim(Str(nwidth)),::cIniFile)
WritePProString("Config","nBottom",Ltrim(Str(nheight)),::cIniFile)
WritePProString("Config","Mode",Ltrim(Str(nstate)),::cIniFile)
DbCloseAll()
ResAllFree()
* ::oImgList:End()
RETURN .t.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com