FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Window position
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Window position
Posted: Wed Mar 25, 2009 02:38 PM

Hi,

I want to save the position of the main window with 'oWnd:nTop' and 'oWnd:nLeft', but although the user has changed the position of the window, the values of 'oWnd:nTop' and 'oWnd:nLeft' didn't change.

What is the right approach?

Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Window position
Posted: Wed Mar 25, 2009 03:23 PM
Hello,

For a customer of mine, the Start-window ( with buttonbar-size ) shows only a Buttonbar.
Each user can move the bar.
A new start shows the bar on the selected position.

Code (fw): Select all Collapse
// saving the WINDOWS-Pos to a INI-File for each user

nPos := oWnd:GetRect()
cCOR1 := ltrim(str(nPos[2]))
cCOR2 := ltrim(str(nPos[3]))

INI oIni FILE cIniFile
oIni:Set("Main", "xPos", cCOR1)
oIni:Set("Main", "yPos", cCOR2)

// ------------------- PROG-Start ----

INI oIni FILE cIniFile
nCOR1 := val(oIni:Get("Main", "xPos", "100"))  // Top-Position
nCOR2 := val(oIni:Get("Main", "yPos", "100"))  // Left-Position

// nCOR1+160 desired Height of the bar ( Bottom )
// nCOR2+630 desired Width of the bar ( Right )
// -------------------------------------------------------
DEFINE WINDOW oWnd FROM nCOR1, nCOR2 TO nCOR1+160, nCOR2+630 PIXEL    
..
..


Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 392
Joined: Tue Mar 10, 2009 11:54 AM
Re: Window position
Posted: Wed Mar 25, 2009 06:08 PM

Hello Uwe,

the method GetRect() was what I'm looking for! :D

THX

Windows 11 Pro 22H2 22621.1848

Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Harbour 3.2.0dev (r2008190002)

FWH 23.10 x86

Continue the discussion