How to read position and size of a dialog box (solved)

How to read position and size of a dialog box (solved)

Postby driessen » Sat Oct 19, 2019 11:44 am

Hello,

How can I read the position and the size of a dilalog box in my application?

Thx.
Last edited by driessen on Sun Oct 20, 2019 7:06 pm, edited 1 time in total.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: How to read position and size of a dialog box

Postby ukoenig » Sat Oct 19, 2019 12:38 pm

Michel ,

:nTop
:nLeft
:nBottom
:nRight


regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to read position and size of a dialog box

Postby Marc Venken » Sat Oct 19, 2019 12:44 pm

From a post of Uwe :

aRect := GetWndRect(oWnd)
oBar := TExplorerBar():New( 0, aRect4 - 300, aRect4 + 720, aRect3 - 75, oWnd )

Mayby also on oDlg
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1446
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: How to read position and size of a dialog box

Postby ukoenig » Sat Oct 19, 2019 3:21 pm

How can I read the position and the size of a dilalog box in my application?


To get the dialog position from screen-top and left and the dialogsize

oRect := oDlg:GetRect()

nTop := oRect:nTop
nLeft := oRect:nLeft

nWidth := oDlg:nWidth
nHeight := oDlg:nHeight

// ----------------

Resizing a dialog You need as well :

nBottom := oRect:nBottom
nRight := oRect:nRight

// restore the dialog to a saved position
oDlg:Move( nTop, nLeft, nRight - nLeft, nBottom - nTop )

Window :

aRect := GetWndRect( oWnd:hWnd )
nTop := aRect[ 1 ]
nLeft := aRect[ 2 ]
nBottom := aRect[ 3 ]
nRight := aRect[ 4 ]

nHeight := aRect[ 3 ] - aRect[ 1 ] + 1
nWidth := aRect[ 4 ] - aRect[ 2 ] + 1

regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to read position and size of a dialog box

Postby driessen » Sat Oct 19, 2019 11:18 pm

Hello everybody,

Thank you all very much for your help.

Testing will start tomorrow.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: How to read position and size of a dialog box

Postby driessen » Sun Oct 20, 2019 7:06 pm

Hello, everyone.

I did some tests and everything is working just fine.

Thank you all so much for your help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 34 guests