Page 1 of 1

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

Posted: Sat Oct 19, 2019 11:44 am
by driessen
Hello,

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

Thx.

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

Posted: Sat Oct 19, 2019 12:38 pm
by ukoenig
Michel ,

:nTop
:nLeft
:nBottom
:nRight


regards
Uwe :D

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

Posted: Sat Oct 19, 2019 12:44 pm
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

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

Posted: Sat Oct 19, 2019 3:21 pm
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

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

Posted: Sat Oct 19, 2019 11:18 pm
by driessen
Hello everybody,

Thank you all very much for your help.

Testing will start tomorrow.

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

Posted: Sun Oct 20, 2019 7:06 pm
by driessen
Hello, everyone.

I did some tests and everything is working just fine.

Thank you all so much for your help.