Size of the window

Post Reply
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Size of the window

Post by Natter »

Hi,

Is it possible to calculate the size of the window in millimeters ?
User avatar
James Bott
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Size of the window

Post 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.
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
hmpaquito
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Size of the window

Post by hmpaquito »

I think no.

There is no function which inform for screen phishic size
User avatar
nageswaragunupudi
Posts: 10729
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 10 times
Contact:

Re: Size of the window

Post by nageswaragunupudi »

FWH has these functions since November 2015:

Code: Select all | Expand


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
Regards

G. N. Rao.
Hyderabad, India
Natter
Posts: 1244
Joined: Mon May 14, 2007 9:49 am

Re: Size of the window

Post by Natter »

Thank you, Rao! I did through GetDeviceCaps() Everything works fine.
Post Reply