Sizes of the screen

Post Reply
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Sizes of the screen

Post by driessen »

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: Sizes of the screen

Post by Richard Chidiak »

Michel

OWND:nHorzRes()

OWND:nVertRes()
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

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 :

Code: Select all

      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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

Driessen

Use the following to get the screen resolution :

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

Rick Lipkin
SC Dept of Health, USA
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

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. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

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
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

James,

Thanks for you suggestion.

I'll try it out.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Post Reply