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

Post Reply
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

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

Post by driessen »

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

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

Post by ukoenig »

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
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

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

Post by Marc Venken »

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 20.08 with Harbour
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

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

Post by ukoenig »

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
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

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

Post by driessen »

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

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

Post by driessen »

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Post Reply