Sizes of the screen

Sizes of the screen

Postby driessen » Mon Nov 05, 2007 9: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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: Sizes of the screen

Postby Richard Chidiak » Mon Nov 05, 2007 9:49 am

Michel

OWND:nHorzRes()

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

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby driessen » 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 :

Code: Select all  Expand view  RUN
      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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Rick Lipkin » Mon Nov 05, 2007 1: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby driessen » Mon Nov 05, 2007 3: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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

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

Postby driessen » Mon Nov 05, 2007 8:43 pm

James,

Thanks for you suggestion.

I'll try it out.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium


Return to FiveWin for Harbour/xHarbour

Who is online

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

cron