Page 1 of 1

Size of the window

PostPosted: Wed Oct 06, 2021 10:42 am
by Natter
Hi,

Is it possible to calculate the size of the window in millimeters ?

Re: Size of the window

PostPosted: Wed Oct 06, 2021 2:57 pm
by James Bott
I found this in my notes:

Note that this method updates the instance vars containing the coordinates of the client area of the window, nTop,nBottom,nWidth, and nHeight. These are NOT the coordinates of the window itself.

To get the coordinates of the window you will have to add the width or height of any objects attached to the window client oClient.

oWnd:coorsUpdate()
nTop:= oWnd:nTop
nTop:= nTop + if(oWnd:oTop!=nil,oWnd:oTop:nHeight,0)
// Note that oMenu doesn't have an attribute nHeight. It is fixed at 20 pixels.
nTop:= nTop + if(oWnd:oMenu!=nil,20,0)


I have never used it.

You will still have to convert from pixels to whatever unit you wish.

Re: Size of the window

PostPosted: Wed Oct 06, 2021 3:05 pm
by hmpaquito
I think no.

There is no function which inform for screen phishic size

Re: Size of the window

PostPosted: Wed Oct 06, 2021 3:23 pm
by nageswaragunupudi
FWH has these functions since November 2015:
Code: Select all  Expand view

ScreenWidthMM()
ScreenHeightMM()
ScreenSize() --> Diagonal size in MM
ScreenSize( .t. ) --> Diagonal size in INCHES
 


Please see WhatsNew.txt November 2015.
You may find more interesting function for touch screens
Also see fwh\source\function\getsysin.prg for these and multiple monitor functions, etc

Re: Size of the window

PostPosted: Wed Oct 06, 2021 6:50 pm
by Natter
Thank you, Rao! I did through GetDeviceCaps() Everything works fine.