Page 1 of 1

Sizes of the screen

Posted: Mon Nov 05, 2007 9:40 am
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.

Re: Sizes of the screen

Posted: Mon Nov 05, 2007 9:49 am
by Richard Chidiak
Michel

OWND:nHorzRes()

OWND:nVertRes()

Posted: Mon Nov 05, 2007 10:37 am
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.

Posted: Mon Nov 05, 2007 1:46 pm
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

Posted: Mon Nov 05, 2007 3:37 pm
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.

Posted: Mon Nov 05, 2007 6:38 pm
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

Posted: Mon Nov 05, 2007 8:43 pm
by driessen
James,

Thanks for you suggestion.

I'll try it out.