Size of the window

Size of the window

Postby Natter » Wed Oct 06, 2021 10:42 am

Hi,

Is it possible to calculate the size of the window in millimeters ?
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am

Re: Size of the window

Postby James Bott » Wed Oct 06, 2021 2:57 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Size of the window

Postby hmpaquito » Wed Oct 06, 2021 3:05 pm

I think no.

There is no function which inform for screen phishic size
hmpaquito
 
Posts: 1482
Joined: Thu Oct 30, 2008 2:37 pm

Re: Size of the window

Postby nageswaragunupudi » Wed Oct 06, 2021 3:23 pm

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
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10619
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Size of the window

Postby Natter » Wed Oct 06, 2021 6:50 pm

Thank you, Rao! I did through GetDeviceCaps() Everything works fine.
Natter
 
Posts: 1203
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 32 guests