FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Size of the window
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Size of the window
Posted: Wed Oct 06, 2021 10:42 AM

Hi,

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

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Size of the window
Posted: Wed Oct 06, 2021 02: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: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
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Size of the window
Posted: Wed Oct 06, 2021 03:05 PM

I think no.

There is no function which inform for screen phishic size

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Size of the window
Posted: Wed Oct 06, 2021 03:23 PM
FWH has these functions since November 2015:
Code (fw): Select all Collapse
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
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Size of the window
Posted: Wed Oct 06, 2021 06:50 PM

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

Continue the discussion