FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Sizes of the screen
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Sizes of the screen
Posted: Mon Nov 05, 2007 09:40 AM

Hello,

How can I read the sizes of my screen ?

MaxCol() and MaxRow() don't work properly, respectivally returning 79 x 23, knowing I use a screen 1280 x 1024.

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Sizes of the screen
Posted: Mon Nov 05, 2007 09:49 AM

Michel

OWND:nHorzRes()

OWND:nVertRes()

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Sizes of the screen
Posted: Mon Nov 05, 2007 10:37 AM
Richard,

Thanks a lot for you answer.

I'm afraid though that this doesn't solve my problem.

I use this code to position a Word-window from my FWH-application :

      OleSetProperty(hWordOle,"Top",43)
      OleSetProperty(hWordOle,"Left",0)
      OleSetProperty(hWordOle,"Width",768)
      OleSetProperty(hWordOle,"Height",553)


This way, I always can see my FWH-bar and everything from Word.

I need to use 768 as a value for maximum width and 553 for the height (it is the maximum height - 2 cm) to present my Word-window the way I want to.

I can't see the link between 1280 (returned by oWnd:nHorzRes()) and the value 768 I have to use.

Any idea ?

Thanks.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Sizes of the screen
Posted: Mon Nov 05, 2007 01:46 PM

Driessen

Use the following to get the screen resolution :

nSCR1 := GetSysMetrics(0) // 1024
nSCR2 := GetSysMetrics(1) // 768

Rick Lipkin
SC Dept of Health, USA

Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Sizes of the screen
Posted: Mon Nov 05, 2007 03:37 PM

Hello Rick,

Thanks for your reaction.

Unfortunately I don't see any difference between GetSysMetrics() and oWnd:nHorzRes() or oWnd:nVertRes(). The results are the same.

Problem is that Word needs other value to set a maximum width. I tested it by using the example I sent before. The Value 768 results in a Word window with a maximum width.

Thanks anyway.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Sizes of the screen
Posted: Mon Nov 05, 2007 06:38 PM

Michel,

>I can't see the link between 1280 (returned by oWnd:nHorzRes()) and the value 768 I have to use.

I assume you want to know how to do the same thing for different screen resolutions? It seems that Word is not using pixels, so perhaps you can just use the ratios:

nWidth := GetSysMetrics(0) * ( 768 / 1280 )
nHeight := GetSysMetrics(1) * ( 553 / 1024 )

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 1467
Joined: Mon Oct 10, 2005 11:26 AM
Sizes of the screen
Posted: Mon Nov 05, 2007 08:43 PM

James,

Thanks for you suggestion.

I'll try it out.

Regards,

Michel D.
Genk (Belgium)


_____________________________________________________________________________________________

I use : FiveWin for (x)Harbour v. 25.12 - Harbour 3.2.0 (May 2025) - xHarbour Builder (January 2020) - Bcc773

Continue the discussion