Hi there - here is something that no-one seems to be able to do: I am trying to get the screen resolutions on a dual monitor setup in Excel 2002.
GetSystemMetrics32(X) gives me some info, as follows - when X is:
(measurements in pixels by the way)
0 - I get the width of the primary monitor
1 - I get the height of the primary monitor
78 - I get the width of the virtual monitor
79 - I get the height of the virtual monitor
The virtual screen is the 2 screens "added together"
For example, if I have 2 monitors side by side:
Monitor 1: Res of 1680 x 1050
Monitor 2: Res of 1600 x 900
I can use GetSystemMetrics32 to get me the width of the primary monitor (1680) and the virtual monitor (3280), thus deducing the 2nd monitor has a width of 3280-1680 = 1600.
HOWEVER - I can't determine the Y height of the second monitor because the virtual monitor is 1050 (The largest of the 2 values)
My thought re:solutions so far have been to:
a) Somehow set the primary monitor temporarily to 800x600. That way, the Y value of the second monitor would be the Y value of the virtual screen (-ie- 900, as 900 is larger than 600). This is clumsy though, and assumes the second monitor is greater than 800x600.
b) Get the X value for the second monitor first, then somehow set the two screens temporarily one above the other (vertically) as opposed to horizontally. The method that I used to work out the width of the 2nd monitor could then be used to work out the height of the 2nd monitor because the virtual screen would be then 1680x1950, and I could work out the 2nd monitor's height = 1950-1050 = 900. Thats also clumsy though, and I don't know how to change horizontal to vertical in VBA.
Any ideas?
GetSystemMetrics32(X) gives me some info, as follows - when X is:
(measurements in pixels by the way)
0 - I get the width of the primary monitor
1 - I get the height of the primary monitor
78 - I get the width of the virtual monitor
79 - I get the height of the virtual monitor
The virtual screen is the 2 screens "added together"
For example, if I have 2 monitors side by side:
Monitor 1: Res of 1680 x 1050
Monitor 2: Res of 1600 x 900
I can use GetSystemMetrics32 to get me the width of the primary monitor (1680) and the virtual monitor (3280), thus deducing the 2nd monitor has a width of 3280-1680 = 1600.
HOWEVER - I can't determine the Y height of the second monitor because the virtual monitor is 1050 (The largest of the 2 values)
My thought re:solutions so far have been to:
a) Somehow set the primary monitor temporarily to 800x600. That way, the Y value of the second monitor would be the Y value of the virtual screen (-ie- 900, as 900 is larger than 600). This is clumsy though, and assumes the second monitor is greater than 800x600.
b) Get the X value for the second monitor first, then somehow set the two screens temporarily one above the other (vertically) as opposed to horizontally. The method that I used to work out the width of the 2nd monitor could then be used to work out the height of the 2nd monitor because the virtual screen would be then 1680x1950, and I could work out the 2nd monitor's height = 1950-1050 = 900. Thats also clumsy though, and I don't know how to change horizontal to vertical in VBA.
Any ideas?