Hi sgp,

Firstly, about your subject line:
My aim was not to cope with trippple or quadrupppple monitors
only mono or dual.
Also I am only looking at the more common side by side arrangement,
not one above the other which would add even more to the complexity.

Someone with 3 monitors (or a vertical arrangement) could adapt my
dual monitor script if they are sufficiently motivated.

3 June 2006, you wrote:

> The version of your WinBarDual5 kit in the files section is beta3
> dated Sep. 30, 2005 - would you please update it with the newer
> version you mention below?

Yes OK. It's now winter in the Southern Hemisphere, thus a good time
to do less gardening and get back into scripting.

The newer version works OK here on my system, but it will take some work
to make it suitable for uploading.

previously I wrote:

>> Following a request from sgp, I have changed WinBarDual so it can
>> cope with the Secondary monitor being on the left of the Primary.
>> That was not too difficult and the changed version works ok.
>>
>> My delay uploading it is because I have to complete some changes
>> about a completely different issue (about the automatuc switching
>> between Mono and Dual versions for people who often connect and
>> disconnect a second monitor) and I haven't had enough spare time
>> for it recently because of a new design contract.
>>

As I wrote, I have fixed the issue of Primary being either left
or right of Secondary monitor.

However I didn't fix my other issue.
That could be a problem for some users if I upload my latest
scripts in their current form.
They work for me personally because I don't keep changing resolutions
and my two monitors are always the same size as each other.

Here's the problem:  [you might be able to suggest a solution?]

I want to make it adjust automatically to changes of screen resolution
and people who use various secondary monitors
-- for example a user with a laptop which is sometimes used alone
with only the built in monitor, sometimes plugged into a larger
monitor at work, sometimes plugged into a smaller monitor at home.

The Mono bar design and command list, for single monitors,
is different from the Dual bar design and command list.
The scripts are capable of showing the suitable bar according to
how many monitors are currently plugged in.
That mono-dual auto switching feature works OK.

The idea is that when you run it for the first time after PowerPro
starts, it runs its @Reconfigure routine, which enquires about your
number of monitors and their sizes (using win.GetSystemMetrics calls)
then sets some statics which will be used in the various moving and
sizing routines whenever you use the WinBar.

Also at startup, the script sets a static zCurrentCXVS to the current
value of win.GetSystemMetrics("SM_CXVIRTUALSCREEN") which is the
combined width of both monitors.
Every time you use the bar, it checks whether SM_CXVIRTUALSCREEN
still equals zCurrentCXVS. If that has changed, it runs its
@Reconfigure routine again.
That method keeps it automatically tuned to the current display setup
without unnecessary running of the long @Reconfigure routine.

The problem is in the @Reconfigure routine.
With win.GetSystemMetrics() you can find every dimension except
the height of the secondary monitor.

Windows OS only provides SM_CXSCREEN and SM_CYSCREEN
which are the dimensions of the primary monitor,
and SM_CXVIRTUALSCREEN and SM_CXVIRTUALSCREEN
which is the rectangle surrounding both monitors.

So we can always find the secondary's width:
SM_CXVIRTUALSCREEN - SM_CXSCREEN

but we can only find the secondary's height sometimes.
If(SM_CYVIRTUALSCREEN > SM_CYSCREEN)
then we know the secondary height = SM_CYVIRTUALSCREEN

Of course it never returns a value for SM_CYVIRTUALSCREEN
which is smaller than SM_CYSCREEN.

If the primary is the same size as the secondary,
and also if the primary is any size larger than the secondary,
then SM_CYVIRTUALSCREEN is always equal to SM_CYSCREEN
so you cannot calculate the secondary's height.

I considered using a lookup table method, to guess
the secondary's height from its width:
If width = 1024 then height = 768
If width = 800 then height = 600
Or simply: height = width * 3 / 4

but then I saw a message (I think it was you, sgp)
from someone with a monitor which is not 4:3 aspect ratio.
Something like 1240 x 768 if I remember right.

I guess those non- 4:3 monitors will happen more in the future
when people who are richer than me buy digital wide screen televisions
which can also serve as a secondary PC monitor.

So you cannot be sure that the monitors are the same height, even if
their widths are the same and SM_CYVIRTUALSCREEN == SM_CYSCREEN

-------------- (intermission for coffee) -----------------

Conclusion: it's impossible to make a flexible mono/dual WinBar
which copes with all possible monitor resolutions automatically.

Unless my @Reconfigure section finds that SM_CYVIRTUALSCREEN
is larger than SM_CYSCREEN, it will have to ask the user what is
the height of the secondary monitor -- whenever it notices that
SM_CXVIRTUALSCREEN or SM_CYVIRTUALSCREEN have changed from the values
which @Reconfigue saved in the static variables.

I explained all the above in the hope that someone will think
of a solution not requiring user input.
If not I'll go ahead with an interactive compromise.

Alan M



Attention: PowerPro's Web site has moved: http://www.ppro.org



SPONSORED LINKS
Computer monitoring software Power pro Computer and internet software
Free computer monitoring software


YAHOO! GROUPS LINKS




Reply via email to